Преглед изворни кода

only define offsetof macro if it isnt already defined

Mike Frysinger пре 19 година
родитељ
комит
9ac20d30b1
2 измењених фајлова са 4 додато и 2 уклоњено
  1. 2 1
      libc/sysdeps/linux/common/getdents.c
  2. 2 1
      libc/sysdeps/linux/common/getdents64.c

+ 2 - 1
libc/sysdeps/linux/common/getdents.c

@@ -28,8 +28,9 @@
 #include <sys/types.h>
 #include <sys/syscall.h>
 
-#undef offsetof
+#ifndef offsetof
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
 
 struct kernel_dirent
 {

+ 2 - 1
libc/sysdeps/linux/common/getdents64.c

@@ -31,8 +31,9 @@
 
 #if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 
 
-#undef offsetof
+#ifndef offsetof
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
 
 struct kernel_dirent64 
 {