diff --git a/exporters/otlp/CMakeLists.txt b/exporters/otlp/CMakeLists.txt index 1d460d6d4c..c3a1bb068f 100644 --- a/exporters/otlp/CMakeLists.txt +++ b/exporters/otlp/CMakeLists.txt @@ -863,6 +863,16 @@ if(WITH_OTLP_FILE) endif() if(BUILD_TESTING) + add_executable(otlp_windows_max_macro_compile_test + test/otlp_windows_max_macro_compile_test.cc) + target_link_libraries( + otlp_windows_max_macro_compile_test ${GTEST_BOTH_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} opentelemetry_otlp_recordable) + gtest_add_tests( + TARGET otlp_windows_max_macro_compile_test + TEST_PREFIX exporter.otlp. + TEST_LIST otlp_windows_max_macro_compile_test) + add_executable(otlp_recordable_test test/otlp_recordable_test.cc) target_link_libraries( otlp_recordable_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} diff --git a/exporters/otlp/test/otlp_windows_max_macro_compile_test.cc b/exporters/otlp/test/otlp_windows_max_macro_compile_test.cc new file mode 100644 index 0000000000..e921dae7dc --- /dev/null +++ b/exporters/otlp/test/otlp_windows_max_macro_compile_test.cc @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +#include + +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" +#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h" +#include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" +#include "opentelemetry/exporters/otlp/otlp_recordable.h" +#undef max + +#include + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace exporter +{ +namespace otlp +{ + +TEST(OtlpWindowsMaxMacroCompileTest, PublicHeadersCompile) +{ + EXPECT_TRUE((std::is_class::value)); + EXPECT_TRUE((std::is_class::value)); + EXPECT_TRUE((std::is_class::value)); + EXPECT_TRUE((std::is_class::value)); +} + +} // namespace otlp +} // namespace exporter +OPENTELEMETRY_END_NAMESPACE