home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / lib / H / access / tupmacs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-06  |  1.0 KB  |  31 lines

  1. /*
  2.  * Tuple macros used by both index tuples and heap tuples.
  3.  * 
  4.  * "$Header: /private/postgres/src/lib/H/access/RCS/tupmacs.h,v 1.3 1992/04/03 01:08:12 mer Exp $"
  5.  */
  6.  
  7. #ifndef TUPMACS_H
  8. #define TUPMACS_H
  9.  
  10. #define att_isnull(ATT, BITS) (!((BITS)[(ATT) >> 3] & (1 << ((ATT) & 0x07))))
  11.  
  12. /* kai:  Changed (char *) *(T)  to  (char *) * (char *) (T)
  13.          -- makes GNU cc much happier, as T may be (void *) */
  14. /* Note: This bug shall occur with any C-Compiler, which defines __STDC__,
  15.    as Pointer is typedef'ed to (void *), if __STDC__ is defined, or
  16.    to (char *), if it isn't. Or are there any compilers, which can
  17.    handle *P, if P is a pointer to void? */
  18. /* Changed (char *) *(char *) (T)   to   (char *) (int) *(char *) (T)
  19.    to stop these error messages:
  20.     "cast to pointer from integer of different size"
  21.  */
  22.  
  23. #define fetchatt(A, T) \
  24.  ((*(A))->attbyval ? \
  25.   ((*(A))->attlen > sizeof(short) ? (char *) *(long *) (T) : \
  26.    ((*(A))->attlen < sizeof(short) ? (char *) (int) *(char *) (T) : \
  27.     (char *) (int) *(short *) (T))) : (char *) (T))
  28.     
  29. #endif
  30.  
  31.