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

Make bits/kernel_types.h include guard names match the include
guard names used by the kernel's asm/posix_types.h to eliminate
gratuitous conflicts and let our file win over the very-likely-
to-be-broken kernel header file.
-Erik

Eric Andersen пре 22 година
родитељ
комит
32644f7899

+ 9 - 3
libc/sysdeps/linux/alpha/bits/kernel_types.h

@@ -1,5 +1,11 @@
-#ifndef _BITS_KERNEL_TYPES_H
-#define _BITS_KERNEL_TYPES_H
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h.  This will avoid gratuitous conflicts 
+ * with the posix_types.h kernel header, and will ensure that 
+ * our private content, and not the kernel header, will win.
+ *  -Erik
+ */
+#ifndef _ALPHA_POSIX_TYPES_H
+#define _ALPHA_POSIX_TYPES_H
 
 typedef unsigned int	__kernel_dev_t;
 typedef unsigned int	__kernel_ino_t;
@@ -27,4 +33,4 @@ typedef __kernel_gid_t __kernel_old_gid_t;
 typedef __kernel_uid_t __kernel_uid32_t;
 typedef __kernel_gid_t __kernel_gid32_t;
 
-#endif /* _BITS_KERNEL_TYPES_H */
+#endif /* _ALPHA_POSIX_TYPES_H */

+ 9 - 3
libc/sysdeps/linux/arm/bits/kernel_types.h

@@ -1,5 +1,11 @@
-#ifndef _BITS_KERNEL_TYPES_H
-#define _BITS_KERNEL_TYPES_H
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h.  This will avoid gratuitous conflicts 
+ * with the posix_types.h kernel header, and will ensure that 
+ * our private content, and not the kernel header, will win.
+ *  -Erik
+ */
+#ifndef __ARCH_ARM_POSIX_TYPES_H
+#define __ARCH_ARM_POSIX_TYPES_H
 
 typedef unsigned short		__kernel_dev_t;
 typedef unsigned long		__kernel_ino_t;
@@ -26,4 +32,4 @@ typedef unsigned short		__kernel_old_uid_t;
 typedef unsigned short		__kernel_old_gid_t;
 typedef long long		__kernel_loff_t;
 
-#endif /* _BITS_KERNEL_TYPES_H */
+#endif /* __ARCH_ARM_POSIX_TYPES_H */

+ 5 - 1
libc/sysdeps/linux/common/bits/kernel_types.h

@@ -1,7 +1,11 @@
 #ifndef _BITS_KERNEL_TYPES_H
 #define _BITS_KERNEL_TYPES_H
 
-/* Sigh.  We need to carefully wrap this one... */
+/* Sigh.  We need to carefully wrap this one...  No guarantees
+ * that the asm/posix_types.h kernel header is working.  Many
+ * arches have broken headers that introduce tons of gratuitous
+ * conflicts with uClibc's namespace.   See bits/kernel_types.h
+ * for i386, arm, etc for examples... */
 #warning You really should include a proper bits/kernel_types.h for your architecture 
 
 #ifndef __GLIBC__

+ 9 - 3
libc/sysdeps/linux/i386/bits/kernel_types.h

@@ -1,5 +1,11 @@
-#ifndef _BITS_KERNEL_TYPES_H
-#define _BITS_KERNEL_TYPES_H
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h.  This will avoid gratuitous conflicts 
+ * with the posix_types.h kernel header, and will ensure that 
+ * our private content, and not the kernel header, will win.
+ *  -Erik
+ */
+#ifndef __ARCH_I386_POSIX_TYPES_H
+#define __ARCH_I386_POSIX_TYPES_H
 
 typedef unsigned short	__kernel_dev_t;
 typedef unsigned long	__kernel_ino_t;
@@ -26,4 +32,4 @@ typedef unsigned short	__kernel_old_uid_t;
 typedef unsigned short	__kernel_old_gid_t;
 typedef long long	__kernel_loff_t;
 
-#endif /* _BITS_KERNEL_TYPES_H */
+#endif /* __ARCH_I386_POSIX_TYPES_H */

+ 9 - 3
libc/sysdeps/linux/m68k/bits/kernel_types.h

@@ -1,5 +1,11 @@
-#ifndef _BITS_KERNEL_TYPES_H
-#define _BITS_KERNEL_TYPES_H
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h.  This will avoid gratuitous conflicts 
+ * with the posix_types.h kernel header, and will ensure that 
+ * our private content, and not the kernel header, will win.
+ *  -Erik
+ */
+#ifndef __ARCH_M68K_POSIX_TYPES_H
+#define __ARCH_M68K_POSIX_TYPES_H
 
 typedef unsigned short	__kernel_dev_t;
 typedef unsigned long	__kernel_ino_t;
@@ -26,4 +32,4 @@ typedef unsigned short	__kernel_old_uid_t;
 typedef unsigned short	__kernel_old_gid_t;
 typedef long long	__kernel_loff_t;
 
-#endif /* _BITS_KERNEL_TYPES_H */
+#endif /* __ARCH_M68K_POSIX_TYPES_H */

+ 9 - 3
libc/sysdeps/linux/mips/bits/kernel_types.h

@@ -1,5 +1,11 @@
-#ifndef _BITS_KERNEL_TYPES_H
-#define _BITS_KERNEL_TYPES_H
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h.  This will avoid gratuitous conflicts 
+ * with the posix_types.h kernel header, and will ensure that 
+ * our private content, and not the kernel header, will win.
+ *  -Erik
+ */
+#ifndef _ASM_POSIX_TYPES_H
+#define _ASM_POSIX_TYPES_H
 
 # if __WORDSIZE == 64
 typedef unsigned int	__kernel_dev_t;
@@ -53,4 +59,4 @@ typedef __kernel_gid_t	__kernel_old_gid_t;
 typedef long long      __kernel_loff_t;
 #endif
 
-#endif /* _BITS_KERNEL_TYPES_H */
+#endif /* _ASM_POSIX_TYPES_H */

+ 11 - 3
libc/sysdeps/linux/powerpc/bits/kernel_types.h

@@ -1,5 +1,12 @@
-#ifndef _BITS_KERNEL_TYPES_H
-#define _BITS_KERNEL_TYPES_H
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h.  This will avoid gratuitous conflicts 
+ * with the posix_types.h kernel header, and will ensure that 
+ * our private content, and not the kernel header, will win.
+ *  -Erik
+ */
+#if ! defined _PPC_POSIX_TYPES_H && ! defined _PPC64_POSIX_TYPES_H
+#define _PPC_POSIX_TYPES_H
+#define _PPC64_POSIX_TYPES_H
 
 # if __WORDSIZE == 64
 typedef unsigned int	__kernel_dev_t;
@@ -53,4 +60,5 @@ typedef unsigned int	__kernel_old_gid_t;
 typedef long long	__kernel_loff_t;
 #endif
 
-#endif /* _BITS_KERNEL_TYPES_H */
+#endif /* ! defined _PPC_POSIX_TYPES_H && ! defined _PPC64_POSIX_TYPES_H */
+

+ 9 - 3
libc/sysdeps/linux/sh/bits/kernel_types.h

@@ -1,5 +1,11 @@
-#ifndef _BITS_KERNEL_TYPES_H
-#define _BITS_KERNEL_TYPES_H
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h.  This will avoid gratuitous conflicts 
+ * with the posix_types.h kernel header, and will ensure that 
+ * our private content, and not the kernel header, will win.
+ *  -Erik
+ */
+#ifndef __ASM_SH_POSIX_TYPES_H
+#define __ASM_SH_POSIX_TYPES_H
 
 typedef unsigned short	__kernel_dev_t;
 typedef unsigned long	__kernel_ino_t;
@@ -26,4 +32,4 @@ typedef unsigned short	__kernel_old_uid_t;
 typedef unsigned short	__kernel_old_gid_t;
 typedef long long	__kernel_loff_t;
 
-#endif /* _BITS_KERNEL_TYPES_H */
+#endif /* __ASM_SH_POSIX_TYPES_H */

+ 11 - 3
libc/sysdeps/linux/sparc/bits/kernel_types.h

@@ -1,5 +1,12 @@
-#ifndef _BITS_KERNEL_TYPES_H
-#define _BITS_KERNEL_TYPES_H
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h.  This will avoid gratuitous conflicts 
+ * with the posix_types.h kernel header, and will ensure that 
+ * our private content, and not the kernel header, will win.
+ *  -Erik
+ */
+#if ! defined __ARCH_SPARC_POSIX_TYPES_H && ! defined __ARCH_SPARC64_POSIX_TYPES_H
+#define __ARCH_SPARC_POSIX_TYPES_H
+#define __ARCH_SPARC64_POSIX_TYPES_H
 
 # if __WORDSIZE == 64
 typedef unsigned long          __kernel_size_t;
@@ -55,4 +62,5 @@ typedef unsigned short	       __kernel_old_gid_t;
 typedef long long              __kernel_loff_t;
 #endif
 
-#endif /* _BITS_KERNEL_TYPES_H */
+#endif /* ! defined __ARCH_SPARC_POSIX_TYPES_H && ! defined __ARCH_SPARC64_POSIX_TYPES_H */
+

+ 4 - 0
libc/sysdeps/linux/v850/bits/kernel_types.h

@@ -10,6 +10,8 @@
  *
  * Written by Miles Bader <miles@gnu.org>
  */
+#ifndef __ASM_V850_POSIX_TYPES_H
+#define __ASM_V850_POSIX_TYPES_H
 
 typedef unsigned int	__kernel_dev_t;
 typedef unsigned long	__kernel_ino_t;
@@ -39,3 +41,5 @@ typedef unsigned short	__kernel_old_gid_t;
 #ifdef __GNUC__
 typedef long long	__kernel_loff_t;
 #endif
+
+#endif /* __ASM_V850_POSIX_TYPES_H */