]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r7337@Kushana: nickm | 2006-08-11 00:42:04 -0700
authorNick Mathewson <nickm@torproject.org>
Fri, 11 Aug 2006 07:42:11 +0000 (07:42 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 11 Aug 2006 07:42:11 +0000 (07:42 +0000)
 Only use __builtin_offsetof with gcc 4 or later

svn:r7028

src/common/util.h

index 55c9a7c28c6451472359abb3c54bcca5e6dfeecd..7db4f28647812dc16d38d26ba08b06ff51d28a26 100644 (file)
@@ -97,7 +97,7 @@ 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__
+#if defined(__GNUC__) && __GNUC__ > 3
 #define STRUCT_OFFSET(tp, member) __builtin_offsetof(tp, member)
 #else
  #define STRUCT_OFFSET(tp, member) \