This is an automated email from the ASF dual-hosted git repository.
gangwu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/main by this push:
new c0f2135fb ORC-1657: Acknowledge clang-cl when disabling compiler
warnings
c0f2135fb is described below
commit c0f2135fb931908be0052ff6da8090dbf24995a9
Author: Yuriy Chernyshov <[email protected]>
AuthorDate: Tue Mar 19 23:17:59 2024 +0800
ORC-1657: Acknowledge clang-cl when disabling compiler warnings
clang-cl defines both `_clang_` and `_MSC_VER` yet it uses MSVC-specific
way to handle `#pragma warning ignore`
Closes #1850 from georgthegreat/patch-2.
Authored-by: Yuriy Chernyshov <[email protected]>
Signed-off-by: Gang Wu <[email protected]>
---
c++/src/Adaptor.hh.in | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/c++/src/Adaptor.hh.in b/c++/src/Adaptor.hh.in
index 6b2174080..b0edc3e3e 100644
--- a/c++/src/Adaptor.hh.in
+++ b/c++/src/Adaptor.hh.in
@@ -69,12 +69,13 @@ typedef SSIZE_T ssize_t;
#define PRAGMA(TXT) _Pragma(#TXT)
-#ifdef __clang__
+#if defined(_MSC_VER)
+ // Handles both cl.exe and clang-cl.exe compilers
+ #define DIAGNOSTIC_IGNORE(XXX) __pragma(warning(disable : XXX))
+#elif defined(__clang__)
#define DIAGNOSTIC_IGNORE(XXX) PRAGMA(clang diagnostic ignored XXX)
#elif defined(__GNUC__)
#define DIAGNOSTIC_IGNORE(XXX) PRAGMA(GCC diagnostic ignored XXX)
-#elif defined(_MSC_VER)
- #define DIAGNOSTIC_IGNORE(XXX) __pragma(warning(disable : XXX))
#else
#define DIAGNOSTIC_IGNORE(XXX)
#endif