diff --git a/ext/src/dll/CMakeLists.txt b/ext/src/dll/CMakeLists.txt index a4e2e06a13..1fa8de354e 100644 --- a/ext/src/dll/CMakeLists.txt +++ b/ext/src/dll/CMakeLists.txt @@ -6,8 +6,8 @@ set(OPENTELEMETRY_EXPORT_DEF add_library(opentelemetry_cpp SHARED dllmain.cc ${OPENTELEMETRY_EXPORT_DEF}) -if(WITH_STL) - add_compile_definitions(WITH_STL) +if(OPENTELEMETRY_STL_VERSION) + add_compile_definitions(OPENTELEMETRY_STL_VERSION) endif() target_link_libraries( diff --git a/ext/src/dll/opentelemetry_cpp.src b/ext/src/dll/opentelemetry_cpp.src index 327815ddcd..15b493fa19 100644 --- a/ext/src/dll/opentelemetry_cpp.src +++ b/ext/src/dll/opentelemetry_cpp.src @@ -73,17 +73,19 @@ EXPORTS // public: static class std::unique_ptr > __cdecl opentelemetry::v1::sdk::metrics::ViewFactory::Create(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &,enum opentelemetry::v1::sdk::metrics::AggregationType) ?Create@ViewFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VView@metrics@sdk@v1@opentelemetry@@U?$default_delete@VView@metrics@sdk@v1@opentelemetry@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@7@00W4AggregationType@2345@@Z -#if defined(WITH_STL) +#if (OPENTELEMETRY_STL_VERSION >= 2017) + // For OPENTELEMETRY_STL_VERSION >= 2017: Use C++ Standard Library's std::string_view for exported function definitions. // public: static class std::unique_ptr > __cdecl opentelemetry::v1::sdk::metrics::MeterSelectorFactory::Create(class std::basic_string_view >,class std::basic_string_view >,class std::basic_string_view >) ?Create@MeterSelectorFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VMeterSelector@metrics@sdk@v1@opentelemetry@@U?$default_delete@VMeterSelector@metrics@sdk@v1@opentelemetry@@@std@@@std@@V?$basic_string_view@DU?$char_traits@D@std@@@7@00@Z // public: static class std::unique_ptr > __cdecl opentelemetry::v1::sdk::metrics::InstrumentSelectorFactory::Create(enum opentelemetry::v1::sdk::metrics::InstrumentType,class std::basic_string_view >,class std::basic_string_view >) ?Create@InstrumentSelectorFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VInstrumentSelector@metrics@sdk@v1@opentelemetry@@U?$default_delete@VInstrumentSelector@metrics@sdk@v1@opentelemetry@@@std@@@std@@W4InstrumentType@2345@V?$basic_string_view@DU?$char_traits@D@std@@@7@1@Z #else + // For OPENTELEMETRY_STL_VERSION < 2017 or undefined: Use nostd::string_view for exported function definitions. // public: static class std::unique_ptr > __cdecl opentelemetry::v1::sdk::metrics::MeterSelectorFactory::Create(class opentelemetry::v1::nostd::string_view,class opentelemetry::v1::nostd::string_view,class opentelemetry::v1::nostd::string_view) ?Create@MeterSelectorFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VMeterSelector@metrics@sdk@v1@opentelemetry@@U?$default_delete@VMeterSelector@metrics@sdk@v1@opentelemetry@@@std@@@std@@Vstring_view@nostd@45@00@Z // public: static class std::unique_ptr > __cdecl opentelemetry::v1::sdk::metrics::InstrumentSelectorFactory::Create(enum opentelemetry::v1::sdk::metrics::InstrumentType,class opentelemetry::v1::nostd::string_view,class opentelemetry::v1::nostd::string_view) ?Create@InstrumentSelectorFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VInstrumentSelector@metrics@sdk@v1@opentelemetry@@U?$default_delete@VInstrumentSelector@metrics@sdk@v1@opentelemetry@@@std@@@std@@W4InstrumentType@2345@Vstring_view@nostd@45@1@Z -#endif // defined(WITH_STL) +#endif // (OPENTELEMETRY_STL_VERSION >= 2017) // public: void __cdecl opentelemetry::v1::sdk::metrics::MeterContext::AddMetricReader(class std::shared_ptr) ?AddMetricReader@MeterContext@metrics@sdk@v1@opentelemetry@@QEAAXV?$shared_ptr@VMetricReader@metrics@sdk@v1@opentelemetry@@@std@@@Z