Correct Clang feature detection

Clang's __GNUC__ and __GNUC_MINOR__ definitions are not reliable and may
not be defined at all when targeting the MSVC ABI. Use feature-checking
macros when possible or check for __clang__.

[guillem@hadrons.org: Update for __ protected keyword change. ]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
Aaron Dierking
2018-06-14 11:38:31 -07:00
committed by Guillem Jover
parent 574c7a1365
commit 7cfa2d4530
2 changed files with 20 additions and 13 deletions

View File

@@ -39,11 +39,11 @@
#define minimum(a, b) ((a) < (b) ? (a) : (b))
#if defined(__GNUC__) || defined(_MSC_VER)
#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
#define inline __inline
#else /* __GNUC__ || _MSC_VER */
#else /* __GNUC__ || __clang__ || _MSC_VER */
#define inline
#endif /* !__GNUC__ && !_MSC_VER */
#endif /* !__GNUC__ && !__clang__ && !_MSC_VER */
#define KEYSZ 32
#define IVSZ 8