[Midnightbsd-cvs] src: cdefs.h: Merge in gcc4 fixes

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon Sep 15 20:56:47 EDT 2008


Log Message:
-----------
Merge in gcc4 fixes

Modified Files:
--------------
    src/sys/sys:
        cdefs.h (r1.4 -> r1.5)

-------------- next part --------------
Index: cdefs.h
===================================================================
RCS file: /home/cvs/src/sys/sys/cdefs.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -L sys/sys/cdefs.h -L sys/sys/cdefs.h -u -r1.4 -r1.5
--- sys/sys/cdefs.h
+++ sys/sys/cdefs.h
@@ -241,6 +241,12 @@
 #define	__always_inline
 #endif
 
+#if __GNUC_PREREQ__(4, 2) /* actually 4.1.3 */
+#define	__gnu89_inline	__attribute__((__gnu_inline__)) __inline
+#else
+#define	__gnu89_inline
+#endif
+
 #if __GNUC_PREREQ__(3, 3)
 #define __nonnull(x)	__attribute__((__nonnull__(x)))
 #else
@@ -310,6 +316,9 @@
  * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
  * require it.
  */
+#if __GNUC_PREREQ__(4, 1)
+#define __offsetof(type, field)	 __builtin_offsetof(type, field)
+#else
 #ifndef __cplusplus
 #define	__offsetof(type, field)	((size_t)(&((type *)0)->field))
 #else
@@ -318,6 +327,7 @@
                  (&reinterpret_cast <const volatile char &>	\
                   (static_cast<type *> (0)->field))))
 #endif
+#endif
 #define	__rangeof(type, start, end) \
 	(__offsetof(type, end) - __offsetof(type, start))
 
@@ -350,7 +360,7 @@
 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
 #ifndef __INTEL_COMPILER
 #define	__strong_reference(sym,aliassym)	\
-	extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
+	extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
 #endif
 #ifdef __STDC__
 #define	__weak_reference(sym,alias)	\
@@ -360,6 +370,10 @@
 	__asm__(".section .gnu.warning." #sym);	\
 	__asm__(".asciz \"" msg "\"");	\
 	__asm__(".previous")
+#define	__sym_compat(sym,impl,verid)	\
+	__asm__(".symver " #impl ", " #sym "@" #verid)
+#define	__sym_default(sym,impl,verid)	\
+	__asm__(".symver " #impl ", " #sym "@@" #verid)
 #else
 #define	__weak_reference(sym,alias)	\
 	__asm__(".weak alias");		\
@@ -368,6 +382,10 @@
 	__asm__(".section .gnu.warning.sym"); \
 	__asm__(".asciz \"msg\"");	\
 	__asm__(".previous")
+#define	__sym_compat(sym,impl,verid)	\
+	__asm__(".symver impl, sym at verid")
+#define	__sym_default(impl,sym,verid)	\
+	__asm__(".symver impl, sym@@verid")
 #endif	/* __STDC__ */
 #endif	/* __GNUC__ || __INTEL_COMPILER */
 


More information about the Midnightbsd-cvs mailing list