mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 06:48:05 +01:00
r7325@Kushana: nickm | 2006-08-10 23:37:31 -0700
Use gcc offsetof where available. svn:r7021
This commit is contained in:
parent
09a895e222
commit
4eddbcf262
1 changed files with 6 additions and 2 deletions
|
@ -91,8 +91,12 @@ extern int dmalloc_free(const char *file, const int line, void *pnt,
|
|||
#define tor_memdup(s, n) _tor_memdup(s, n DMALLOC_ARGS)
|
||||
|
||||
/** Return the offset of <b>member</b> within the type <b>tp</b>, in bytes */
|
||||
#ifdef __GNUC__
|
||||
#define STRUCT_OFFSET(tp, member) __builtin_offsetof(tp, member)
|
||||
#else
|
||||
#define STRUCT_OFFSET(tp, member) \
|
||||
((off_t) (((char*)&((tp*)0)->member)-(char*)0))
|
||||
#endif
|
||||
|
||||
/* String manipulation */
|
||||
#define HEX_CHARACTERS "0123456789ABCDEFabcdef"
|
||||
|
|
Loading…
Add table
Reference in a new issue