Remove offsetof definition
authorPeter Eisentraut <[email protected]>
Tue, 23 Aug 2022 13:39:36 +0000 (15:39 +0200)
committerPeter Eisentraut <[email protected]>
Tue, 23 Aug 2022 13:40:37 +0000 (15:40 +0200)
This was only needed to deal with some ancient and no longer supported
systems.

Reviewed-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/9a5223a2-3e25-d4fb-f092-01ec17428584%40enterprisedb.com

src/include/c.h

index dfc366b026f47ee71cb2f709688cf77ebbccf788..a381f9a6c40174a1ce1f9662fb042e7899d797b4 100644 (file)
@@ -30,7 +30,7 @@
  *     2)      bool, true, false
  *     3)      standard system types
  *     4)      IsValid macros for system types
- *     5)      offsetof, lengthof, alignment
+ *     5)      lengthof, alignment
  *     6)      assertions
  *     7)      widely useful macros
  *     8)      random stuff
@@ -703,20 +703,9 @@ typedef NameData *Name;
 
 
 /* ----------------------------------------------------------------
- *             Section 5:  offsetof, lengthof, alignment
+ *             Section 5:  lengthof, alignment
  * ----------------------------------------------------------------
  */
-/*
- * offsetof
- *     Offset of a structure/union field within that structure/union.
- *
- *     XXX This is supposed to be part of stddef.h, but isn't on
- *     some systems (like SunOS 4).
- */
-#ifndef offsetof
-#define offsetof(type, field)  ((long) &((type *)0)->field)
-#endif                         /* offsetof */
-
 /*
  * lengthof
  *     Number of elements in an array.