summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-12 02:30:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:56 -0500
commit91d0c700f6e8d5d2b80becfbb24f9db3422d8019 (patch)
tree6cd7599168a8e85fb46077582661daa5c45b6291 /source
parent52013bbe545d0cc238c6595361cd007ad533fd68 (diff)
downloadsamba-91d0c700f6e8d5d2b80becfbb24f9db3422d8019.tar.gz
r24344: Make libreplace provide offsetof.
Diffstat (limited to 'source')
-rw-r--r--source/lib/replace/README1
-rw-r--r--source/lib/replace/replace.h4
-rw-r--r--source/lib/tdb/common/tdb_private.h4
3 files changed, 5 insertions, 4 deletions
diff --git a/source/lib/replace/README b/source/lib/replace/README
index 77558b2ca96..e7b89936c0f 100644
--- a/source/lib/replace/README
+++ b/source/lib/replace/README
@@ -92,6 +92,7 @@ ZERO_STRUCTPN
ZERO_ARRAY
ARRAY_SIZE
PTR_DIFF
+offsetof
Headers:
stdint.h
diff --git a/source/lib/replace/replace.h b/source/lib/replace/replace.h
index 62d480e20ef..411d4012fe6 100644
--- a/source/lib/replace/replace.h
+++ b/source/lib/replace/replace.h
@@ -53,6 +53,10 @@
#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,
diff --git a/source/lib/tdb/common/tdb_private.h b/source/lib/tdb/common/tdb_private.h
index b33baaed7af..2b91ebd0bac 100644
--- a/source/lib/tdb/common/tdb_private.h
+++ b/source/lib/tdb/common/tdb_private.h
@@ -38,10 +38,6 @@
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)