diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-08-12 01:06:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:29:31 -0500 |
commit | db2666759d90610648c32a8c861529004d0624f1 (patch) | |
tree | 25322bb4982c80617a95933b7f5b46a4109c16bd /source3/lib/replace | |
parent | 594bbfcdeedc306ce4634dd827df342e86ed8390 (diff) | |
download | samba-db2666759d90610648c32a8c861529004d0624f1.tar.gz samba-db2666759d90610648c32a8c861529004d0624f1.tar.bz2 samba-db2666759d90610648c32a8c861529004d0624f1.zip |
r24341: Make libreplace provide offsetof.
(This used to be commit 4a5fa715a6af281282092644817599f79806981d)
Diffstat (limited to 'source3/lib/replace')
-rw-r--r-- | source3/lib/replace/README | 1 | ||||
-rw-r--r-- | source3/lib/replace/replace.h | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/source3/lib/replace/README b/source3/lib/replace/README index 77558b2ca9..e7b89936c0 100644 --- a/source3/lib/replace/README +++ b/source3/lib/replace/README @@ -92,6 +92,7 @@ ZERO_STRUCTPN ZERO_ARRAY ARRAY_SIZE PTR_DIFF +offsetof Headers: stdint.h diff --git a/source3/lib/replace/replace.h b/source3/lib/replace/replace.h index 06173bd84b..e827719951 100644 --- a/source3/lib/replace/replace.h +++ b/source3/lib/replace/replace.h @@ -52,6 +52,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, |