r24341: Make libreplace provide offsetof.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 12 Aug 2007 01:06:02 +0000 (01:06 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:29:31 +0000 (12:29 -0500)
(This used to be commit 4a5fa715a6af281282092644817599f79806981d)

source3/lib/replace/README
source3/lib/replace/replace.h
source3/lib/tdb/common/tdb_private.h

index 77558b2ca96718f95c3e58a950b0697f1c685e70..e7b89936c0f6520ed707e93958c00230b1399e61 100644 (file)
@@ -92,6 +92,7 @@ ZERO_STRUCTPN
 ZERO_ARRAY
 ARRAY_SIZE
 PTR_DIFF
+offsetof
 
 Headers:
 stdint.h
index 06173bd84b963e68fd9b980ff2bd7bd88c7987f1..e827719951f813c2c6d47b698f2ab41c247799fe 100644 (file)
 #define QSORT_CAST (int (*)(const void *, const void *))
 #endif
 
+#ifndef offsetof
+#define offsetof(t,f) ((unsigned int)&((t *)0)->f)
+#endif
+
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 /* force off HAVE_INTTYPES_H so that roken doesn't try to include both,
index 032b0ca6382a6d26a2b581df93a16cb69b15a0a7..d2f2c23d7296901cf3d83f178fead2f34094df56 100644 (file)
 typedef uint32_t tdb_len_t;
 typedef uint32_t tdb_off_t;
 
-#ifndef offsetof
-#define offsetof(t,f) ((unsigned int)&((t *)0)->f)
-#endif
-
 #define TDB_MAGIC_FOOD "TDB file\n"
 #define TDB_VERSION (0x26011967 + 6)
 #define TDB_MAGIC (0x26011999U)