summaryrefslogtreecommitdiff
path: root/Xfuncproto.h.in
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@code-monkey.de>2007-05-01 14:52:57 +0200
committerTilman Sauerbeck <tilman@code-monkey.de>2007-05-01 14:52:57 +0200
commit0c55a57dca2e888ba089e280f62e1c5bb55db7d7 (patch)
treeebaf5135ce123ea8e3d26f2e8fc5f01e03588366 /Xfuncproto.h.in
parent30f5eedf800f6683161fca9fc3e2d6ddc9ce0ac3 (diff)
Enable GCC's visibility attributes on GCC 4 or greater only.
Diffstat (limited to 'Xfuncproto.h.in')
-rw-r--r--Xfuncproto.h.in19
1 files changed, 12 insertions, 7 deletions
diff --git a/Xfuncproto.h.in b/Xfuncproto.h.in
index e8f02be..2421ae4 100644
--- a/Xfuncproto.h.in
+++ b/Xfuncproto.h.in
@@ -85,24 +85,29 @@ in this Software without prior written authorization from The Open Group.
# define _X_ATTRIBUTE_PRINTF(x,y)
#endif /* GNUC >= 4 */
-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
+#if defined(__GNUC__) && (__GNUC__ >= 4)
# define _X_EXPORT __attribute__((visibility("default")))
# define _X_HIDDEN __attribute__((visibility("hidden")))
# define _X_INTERNAL __attribute__((visibility("internal")))
-# define _X_LIKELY(x) __builtin_expect(!!(x), 1)
-# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
-# define _X_INLINE inline
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
# define _X_EXPORT __global
# define _X_HIDDEN __hidden
# define _X_INTERNAL __hidden
+#else /* not gcc >= 4 and not Sun Studio >= 8 */
+# define _X_EXPORT
+# define _X_HIDDEN
+# define _X_INTERNAL
+#endif /* GNUC >= 4 */
+
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
+# define _X_LIKELY(x) __builtin_expect(!!(x), 1)
+# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
+# define _X_INLINE inline
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
# define _X_LIKELY(x) (x)
# define _X_UNLIKELY(x) (x)
# define _X_INLINE inline
#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
-# define _X_EXPORT
-# define _X_HIDDEN
-# define _X_INTERNAL
# define _X_LIKELY(x) (x)
# define _X_UNLIKELY(x) (x)
# define _X_INLINE