diff --git a/api/include/opentelemetry/version.h b/api/include/opentelemetry/version.h index 7b9fa1da02..b1c61ebff9 100644 --- a/api/include/opentelemetry/version.h +++ b/api/include/opentelemetry/version.h @@ -6,6 +6,20 @@ #include "opentelemetry/common/macros.h" #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)) +# 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 + #ifndef OPENTELEMETRY_ABI_VERSION_NO # define OPENTELEMETRY_ABI_VERSION_NO 1 #endif