mirror of
https://gitlab.freedesktop.org/xorg/proto/xorgproto.git
synced 2026-05-05 07:38:10 +02:00
Enable GCC's visibility attributes on GCC 4 or greater only.
This commit is contained in:
parent
30f5eedf80
commit
0c55a57dca
1 changed files with 12 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue