瀏覽代碼

only define offsetof() if it isnt already defined

Mike Frysinger 18 年之前
父節點
當前提交
e0605c73da
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      librt/timer_create.c

+ 3 - 1
librt/timer_create.c

@@ -13,7 +13,9 @@
 
 #ifdef __NR_timer_create
 
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
 
 #define __NR___syscall_timer_create __NR_timer_create
 static inline _syscall3(int, __syscall_timer_create, clockid_t, clock_id,