1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r24337: Make libreplace provide offsetof.

(This used to be commit 48d1aa4fcf)
This commit is contained in:
Jelmer Vernooij 2007-08-11 21:30:19 +00:00 committed by Gerald (Jerry) Carter
parent f3e1363281
commit bc13766a76
3 changed files with 5 additions and 4 deletions

View File

@ -92,6 +92,7 @@ ZERO_STRUCTPN
ZERO_ARRAY ZERO_ARRAY
ARRAY_SIZE ARRAY_SIZE
PTR_DIFF PTR_DIFF
offsetof
Headers: Headers:
stdint.h stdint.h

View File

@ -52,6 +52,10 @@
#define QSORT_CAST (int (*)(const void *, const void *)) #define QSORT_CAST (int (*)(const void *, const void *))
#endif #endif
#ifndef offsetof
#define offsetof(t,f) ((unsigned int)&((t *)0)->f)
#endif
#ifdef HAVE_STDINT_H #ifdef HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
/* force off HAVE_INTTYPES_H so that roken doesn't try to include both, /* force off HAVE_INTTYPES_H so that roken doesn't try to include both,

View File

@ -37,10 +37,6 @@
typedef uint32_t tdb_len_t; typedef uint32_t tdb_len_t;
typedef uint32_t tdb_off_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_MAGIC_FOOD "TDB file\n"
#define TDB_VERSION (0x26011967 + 6) #define TDB_VERSION (0x26011967 + 6)
#define TDB_MAGIC (0x26011999U) #define TDB_MAGIC (0x26011999U)