Move offsetof into missing.h, where it really belongs
authoraland <aland>
Sat, 16 Feb 2008 09:20:05 +0000 (09:20 +0000)
committeraland <aland>
Sat, 16 Feb 2008 09:20:05 +0000 (09:20 +0000)
src/include/conffile.h
src/include/missing.h
src/include/packet.h

index 31eba43..cdcfaea 100644 (file)
@@ -43,10 +43,6 @@ typedef struct CONF_PARSER {
 /* This preprocessor trick will be useful in initializing CONF_PARSER struct */
 #define XStringify(x) #x
 #define Stringify(x) XStringify(x)
-/* And this pointer trick too */
-#ifndef offsetof
-# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
 
 void           cf_pair_free(CONF_PAIR **cp);
 void           cf_section_free(CONF_SECTION **cp);
index 42f05a5..cb17009 100644 (file)
@@ -391,4 +391,8 @@ int gettimeofday (struct timeval *tv, void *tz);
 #define F_TEST  _LK_RLCK  /* Test section for locks by other processes. */
 #endif
 
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
 #endif /* _FR_MISSING_H */
index f49d5cb..ed0cfde 100644 (file)
@@ -62,11 +62,6 @@ RADIUS_PACKET *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set);
 int fr_packet_list_num_incoming(fr_packet_list_t *pl);
 int fr_packet_list_num_outgoing(fr_packet_list_t *pl);
 
-
-#ifndef offsetof
-# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
-
 /*
  *     "find" returns a pointer to the RADIUS_PACKET* member in the
  *     caller's structure.  In order to get the pointer to the *top*