commit b9c6050de5c03c55b7b1adb6626c01743abcea41 parent cf4c04c5891623b33ac2bbdddc9df280b55a00b3 Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev> Date: Tue, 9 Sep 2025 01:22:16 +0200 mhd_bithelpers: update macros for the clang-cl Diffstat:
| M | src/mhd2/mhd_bithelpers.h | | | 13 | ++++++++----- |
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/mhd2/mhd_bithelpers.h b/src/mhd2/mhd_bithelpers.h @@ -52,11 +52,14 @@ #include "mhd_assert.h" -#if defined(_MSC_FULL_VER) && (! defined(__clang__) || (defined(__c2__) && \ - defined(__OPTIMIZE__))) -/* Declarations for VC & Clang/C2 built-ins */ -# include <intrin.h> -# define mhd_HAS_VC_INTRINSICS 1 +#if defined(_MSC_FULL_VER) +/* Clang-cl produces a function call instead of intrinsics if optimisations + are turned off. */ +# if (! defined(__clang__)) || defined(__OPTIMIZE__) +/* Declarations for VC & Clang-cl built-ins */ +# include <intrin.h> +# define mhd_HAS_VC_INTRINSICS 1 +# endif /* (! __clang__) || (__OPTIMIZE__) */ #endif /* _MSC_FULL_VER */ #include "mhd_byteorder.h"