From 6b12e4047863dfb2060f92c42bd7ac8960dfd672 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 28 Mar 2017 21:55:26 +0200 Subject: [PATCH] :checkered_flag: removed __builtin_expect for MSVC --- src/json.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 48607bb89..c10c4037d 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -91,8 +91,13 @@ SOFTWARE. #endif // manual branch prediction -#define JSON_LIKELY(x) __builtin_expect(!!(x), 1) -#define JSON_UNLIKELY(x) __builtin_expect(!!(x), 0) +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #define JSON_LIKELY(x) __builtin_expect(!!(x), 1) + #define JSON_UNLIKELY(x) __builtin_expect(!!(x), 0) +#else + #define JSON_LIKELY(x) x + #define JSON_UNLIKELY(x) x +#endif /*! @brief namespace for Niels Lohmann