Add missing rcu_cmpxchg_pointer define
[urcu.git] / compiler.h
index 142b9a60fa98c011096a1fba025d962e63b07520..99972f30e2ba89726f663c78261f4e9203b6d026 100644 (file)
  */
 #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&x)
 
+#if (__GNUC__ == 4)
+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
+#endif
+
+#ifdef __compiler_offsetof
+#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
 #endif /* _COMPILER_H */
This page took 0.022398 seconds and 4 git commands to generate.