Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Goulet
Tor
Commits
4eddbcf2
Commit
4eddbcf2
authored
Aug 11, 2006
by
Nick Mathewson
🎨
Browse files
r7325@Kushana: nickm | 2006-08-10 23:37:31 -0700
Use gcc offsetof where available. svn:r7021
parent
09a895e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/common/util.h
View file @
4eddbcf2
...
...
@@ -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 */
#define STRUCT_OFFSET(tp, member) \
((off_t) (((char*)&((tp*)0)->member)-(char*)0))
#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"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment