Re: [HACKERS] Platforms with v6.3 trouble - Mailing list pgsql-hackers

From Billy G. Allie
Subject Re: [HACKERS] Platforms with v6.3 trouble
Date
Msg-id m0y8HhA-0009hQC@bgalli.mug.org
Whole thread Raw
In response to Re: [HACKERS] Platforms with v6.3 trouble  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Platforms with v6.3 trouble  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
On the SCO UNIXWARE (UNIVEL) port, it is only necessary to replace the macro
definition of fastgetattr with a static function in heapam.h in order to get
the code to compile.  I guess the people who wrote the compile could not
concieve of anyone nesting the trinary operator (?:) to such a depth :-).  The
UNIXWARE compiler does an excellent job of in-lining the function on it's own
without the macro.  The patch for the version of heapam.h I am using follows
(I am currently using USE_UNIVEL_CC_ASM as the trigger, but that can be
changed).

Bruce,  will this change work?  I am not as familiar with this section of code
as I would like to be.

----
*** src/include/access/heapam.h.orig    Fri Feb 13 20:18:33 1998
--- src/include/access/heapam.h Sat Feb 14 09:03:40 1998
***************
*** 88,93 ****
--- 88,142 ----
   *
   * ----------------
   */
+ #if defined(USE_UNIVEL_CC_ASM)
+ extern Datum nocachegetattr(HeapTuple tup, int attnum,
+                        TupleDesc att, bool *isnull);
+
+ static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
+                        bool *isnull)
+ {
+     return (
+       (attnum) > 0 ?
+       (
+           ((isnull) ? (*(isnull) = false) : (dummyret)NULL),
+           HeapTupleNoNulls(tup) ?
+           (
+               ((tupleDesc)->attrs[(attnum)-1]->attcacheoff != -1 ||
+                (attnum) == 1) ?
+               (
+                   (Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]),
+                       (char *) (tup) + (tup)->t_hoff +
+                       (
+                           ((attnum) != 1) ?
+                               (tupleDesc)->attrs[(attnum)-1]->attcacheoff
+                           :
+                               0
+                       )
+                   )
+               )
+               :
+                   nocachegetattr((tup), (attnum), (tupleDesc), (isnull))
+           )
+           :
+           (
+               att_isnull((attnum)-1, (tup)->t_bits) ?
+               (
+                   ((isnull) ? (*(isnull) = true) : (dummyret)NULL),
+                   (Datum)NULL
+               )
+               :
+               (
+                   nocachegetattr((tup), (attnum), (tupleDesc), (isnull))
+               )
+           )
+       )
+       :
+       (
+            (Datum)NULL
+       )
+   );
+ }
+ #else
  #define fastgetattr(tup, attnum, tupleDesc, isnull) \
  ( \
    AssertMacro((attnum) > 0) ? \
***************
*** 129,136 ****
         (Datum)NULL \
    ) \
  )
!
!

  /* ----------------
   *        heap_getattr
--- 178,184 ----
         (Datum)NULL \
    ) \
  )
! #endif

  /* ----------------
   *        heap_getattr

--
____       | Billy G. Allie    | Domain....: Bill.Allie@mug.org
|  /|      | 7436 Hartwell     | Compuserve: 76337,2061
|-/-|----- | Dearborn, MI 48126| MSN.......: B_G_Allie@email.msn.com
|/  |LLIE  | (313) 582-1540    |



pgsql-hackers by date:

Previous
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: INT2OID, etc.
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] INT2OID, etc.