diff options
author | Rickard Green <[email protected]> | 2014-05-22 18:18:47 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2014-05-22 18:27:57 +0200 |
commit | 4eabd78146594a9cd75eb9dc62ba449f7b6b8eb5 (patch) | |
tree | 4ef05d6d229ceb4e4baf5c816e108e4dcbe6a86e /erts | |
parent | adb5dc0090bc419e2c4c1250653badbddeb6263b (diff) | |
download | otp-4eabd78146594a9cd75eb9dc62ba449f7b6b8eb5.tar.gz otp-4eabd78146594a9cd75eb9dc62ba449f7b6b8eb5.tar.bz2 otp-4eabd78146594a9cd75eb9dc62ba449f7b6b8eb5.zip |
Do not use __always_inline__ attribute unless gcc vsn >= 3.1.1
Diffstat (limited to 'erts')
-rw-r--r-- | erts/include/internal/ethread.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/erts/include/internal/ethread.h b/erts/include/internal/ethread.h index 6f9bc184ef..230388cce5 100644 --- a/erts/include/internal/ethread.h +++ b/erts/include/internal/ethread.h @@ -51,10 +51,27 @@ # endif #endif +#if !defined(__GNUC__) +# define ETHR_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) 0 +#elif !defined(__GNUC_MINOR__) +# define ETHR_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \ + ((__GNUC__ << 24) >= (((MAJ) << 24) | ((MIN) << 12) | (PL))) +#elif !defined(__GNUC_PATCHLEVEL__) +# define ETHR_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \ + (((__GNUC__ << 24) | (__GNUC_MINOR__ << 12)) >= (((MAJ) << 24) | ((MIN) << 12) | (PL))) +#else +# define ETHR_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \ + (((__GNUC__ << 24) | (__GNUC_MINOR__ << 12) | __GNUC_PATCHLEVEL__) >= (((MAJ) << 24) | ((MIN) << 12) | (PL))) +#endif + #undef ETHR_INLINE #if defined(__GNUC__) # define ETHR_INLINE __inline__ -# define ETHR_FORCE_INLINE __inline__ __attribute__((__always_inline__)) +# if ETHR_AT_LEAST_GCC_VSN__(3, 1, 1) +# define ETHR_FORCE_INLINE __inline__ __attribute__((__always_inline__)) +# else +# define ETHR_FORCE_INLINE __inline__ +# endif #elif defined(__WIN32__) # define ETHR_INLINE __forceinline # define ETHR_FORCE_INLINE __forceinline @@ -288,19 +305,6 @@ ETHR_PROTO_NORETURN__ ethr_fatal_error__(const char *file, const char *func, int err); -#if !defined(__GNUC__) -# define ETHR_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) 0 -#elif !defined(__GNUC_MINOR__) -# define ETHR_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \ - ((__GNUC__ << 24) >= (((MAJ) << 24) | ((MIN) << 12) | (PL))) -#elif !defined(__GNUC_PATCHLEVEL__) -# define ETHR_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \ - (((__GNUC__ << 24) | (__GNUC_MINOR__ << 12)) >= (((MAJ) << 24) | ((MIN) << 12) | (PL))) -#else -# define ETHR_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \ - (((__GNUC__ << 24) | (__GNUC_MINOR__ << 12) | __GNUC_PATCHLEVEL__) >= (((MAJ) << 24) | ((MIN) << 12) | (PL))) -#endif - #if !ETHR_AT_LEAST_GCC_VSN__(2, 96, 0) #define __builtin_expect(X, Y) (X) #endif |