Skip to content

Commit

Permalink
Make formatting happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcsgh committed Jan 18, 2024
1 parent 69154a1 commit 697794d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 4 additions & 4 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ CPP_STDLIBS = [

string_flag(
name = "with_cxx_stdlib",
values = CPP_STDLIBS,
build_setting_default = "best",
values = CPP_STDLIBS,
)

cc_library(
Expand All @@ -33,11 +33,11 @@ cc_library(
"//conditions:default": [],
}) + select({
":set_cxx_stdlib_none": [],

### automatic selection
":set_cxx_stdlib_best": ["OPENTELEMETRY_STL_VERSION=(__cplusplus/100)"],
# See https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus
":set_cxx_stdlib_best_and_msvc": ["OPENTELEMETRY_STL_VERSION=(_MSVC_LANG/100)"],

### manual selection
":set_cxx_stdlib_2014": ["OPENTELEMETRY_STL_VERSION=2014"],
":set_cxx_stdlib_2017": ["OPENTELEMETRY_STL_VERSION=2017"],
":set_cxx_stdlib_2020": ["OPENTELEMETRY_STL_VERSION=2020"],
Expand Down Expand Up @@ -68,6 +68,6 @@ config_setting(

config_setting(
name = "set_cxx_stdlib_best_and_msvc",
flag_values = {":with_cxx_stdlib": "best"},
constraint_values = ["@bazel_tools//tools/cpp:msvc"],
flag_values = {":with_cxx_stdlib": "best"},
)
13 changes: 10 additions & 3 deletions api/include/opentelemetry/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@
#include "opentelemetry/detail/preprocessor.h"

#if defined(OPENTELEMETRY_STL_VERSION)
# if (!defined(_MSVC_LANG) && OPENTELEMETRY_STL_VERSION > (__cplusplus/100)) || \
(defined(_MSVC_LANG) && OPENTELEMETRY_STL_VERSION > (_MSVC_LANG/100))
# pragma message OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_STL_VERSION) " vs. " OPENTELEMETRY_STRINGIFY(__cplusplus)
# if (!defined(_MSVC_LANG) && OPENTELEMETRY_STL_VERSION > (__cplusplus / 100)) || \
(defined(_MSVC_LANG) && OPENTELEMETRY_STL_VERSION > (_MSVC_LANG / 100))
# if defined(_MSVC_LANG)
# pragma message OPENTELEMETRY_STRINGIFY( \
OPENTELEMETRY_STL_VERSION) " vs. " OPENTELEMETRY_STRINGIFY(_MSVC_LANG)
# else
# pragma message OPENTELEMETRY_STRINGIFY( \
OPENTELEMETRY_STL_VERSION) " vs. " OPENTELEMETRY_STRINGIFY( \
__cplusplus)
# endif
# error "OPENTELEMETRY_STL_VERSION is set to a version newer than the curent C++ version."
# endif
#endif
Expand Down

0 comments on commit 697794d

Please sign in to comment.