diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-05-31 23:33:17 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-05-31 23:33:17 -0400 |
commit | 8e27c6b3fa864147fe5ebdaccf434192405f4357 (patch) | |
tree | 6ab44bc17a8db680fbe62973bdc83554abf15959 /misc.h | |
parent | 392ec3465e4225338cf0dd94423d42c0cd6531bb (diff) | |
download | cryptopp-git-8e27c6b3fa864147fe5ebdaccf434192405f4357.tar.gz |
Fix OS X compile with Clang later than 6.0
It looks like Apple Clang 6.0 does not provide _blsr_u32 and friends. Later versions of Clang defines _blsr_u32 and it causes a stream of warnings.
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -80,12 +80,21 @@ # include <immintrin.h>
#endif // GCC and BMI
-// More LLVM bullshit
+// More LLVM bullshit. Apple Clang 6.0 does not define them.
+// Later version of Clang defines them and results in warnings.
#if defined(__clang__)
-# define _blsr_u32 __blsr_u32
-# define _blsr_u64 __blsr_u64
-# define _tzcnt_u32 __tzcnt_u32
-# define _tzcnt_u64 __tzcnt_u64
+# ifndef _blsr_u32
+# define _blsr_u32 __blsr_u32
+# endif
+# ifndef _blsr_u64
+# define _blsr_u64 __blsr_u64
+# endif
+# ifndef _tzcnt_u32
+# define _tzcnt_u32 __tzcnt_u32
+# endif
+# ifndef _tzcnt_u64
+# define _tzcnt_u64 __tzcnt_u64
+# endif
#endif
#endif // CRYPTOPP_DOXYGEN_PROCESSING
|