From 6cfffa3fbdfae49acaf562564eabd9af2a450b82 Mon Sep 17 00:00:00 2001 From: owent Date: Fri, 11 Apr 2025 11:48:30 +0800 Subject: [PATCH 1/3] Fixes warnings of ciso646 in C++17 --- .../nostd/internal/absl/base/options.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/api/include/opentelemetry/nostd/internal/absl/base/options.h b/api/include/opentelemetry/nostd/internal/absl/base/options.h index 26665b151e..ac50094925 100644 --- a/api/include/opentelemetry/nostd/internal/absl/base/options.h +++ b/api/include/opentelemetry/nostd/internal/absl/base/options.h @@ -69,8 +69,21 @@ // Include a standard library header to allow configuration based on the // standard library in use. -#ifdef __cplusplus -#include +// Using C++20 feature-test macros when possible, otherwise fall back to +// ciso646/iso646.h.There are warnings when includeing ciso646 in C++17 mode +#ifdef __has_include +# if __has_include() +# include +# endif +#elif defined(_MSC_VER) && \ + ((defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) +# if _MSC_VER >= 1922 +# include +# endif +#elif defined(__cplusplus) && __cplusplus < 201703L +# include +#else +# include #endif // ----------------------------------------------------------------------------- From 82136b665ec9f320584acd121cc2f06b57c1f901 Mon Sep 17 00:00:00 2001 From: owent Date: Fri, 11 Apr 2025 15:09:14 +0800 Subject: [PATCH 2/3] Do not use C style header --- .../nostd/internal/absl/base/options.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/api/include/opentelemetry/nostd/internal/absl/base/options.h b/api/include/opentelemetry/nostd/internal/absl/base/options.h index ac50094925..f631fd89b1 100644 --- a/api/include/opentelemetry/nostd/internal/absl/base/options.h +++ b/api/include/opentelemetry/nostd/internal/absl/base/options.h @@ -80,10 +80,20 @@ # if _MSC_VER >= 1922 # include # endif -#elif defined(__cplusplus) && __cplusplus < 201703L -# include #else -# include +# if defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcpp" +# elif defined(__clang__) || defined(__apple_build_version__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wcpp" +# endif +# include +# if defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__) +# pragma GCC diagnostic pop +# elif defined(__clang__) || defined(__apple_build_version__) +# pragma clang diagnostic pop +# endif #endif // ----------------------------------------------------------------------------- From 8a36161f376e82bb590207bcd05ffe7d95ca5804 Mon Sep 17 00:00:00 2001 From: owent Date: Tue, 15 Apr 2025 10:45:27 +0800 Subject: [PATCH 3/3] Fixes typo --- api/include/opentelemetry/nostd/internal/absl/base/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/include/opentelemetry/nostd/internal/absl/base/options.h b/api/include/opentelemetry/nostd/internal/absl/base/options.h index f631fd89b1..c4b00a3d38 100644 --- a/api/include/opentelemetry/nostd/internal/absl/base/options.h +++ b/api/include/opentelemetry/nostd/internal/absl/base/options.h @@ -70,7 +70,7 @@ // Include a standard library header to allow configuration based on the // standard library in use. // Using C++20 feature-test macros when possible, otherwise fall back to -// ciso646/iso646.h.There are warnings when includeing ciso646 in C++17 mode +// ciso646/iso646.h.There are warnings when including ciso646 in C++17 mode #ifdef __has_include # if __has_include() # include