r24344: Make libreplace provide offsetof.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 12 Aug 2007 02:30:25 +0000 (02:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:56 +0000 (12:23 -0500)
source/lib/replace/README
source/lib/replace/replace.h
source/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 62d480e20efb7198e6ca669ccc5ceb4380bae8ed..411d4012fe6331c9ed9b39328b91b18b5bf770c1 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 b33baaed7af6cfa5f2f7059d77ad4cd5215015f8..2b91ebd0bac879c09f8a5bdd159c624b616cb09e 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)