diff --git a/CHANGELOG.md b/CHANGELOG.md index b31fe5f851..07005073f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ Increment the: ## [Unreleased] +* [BUILD] Avoid break caused by max() macro on windows + [#3863](https://github.com/open-telemetry/opentelemetry-cpp/pull/3863) + ## [1.25 2026-02-07] * [RELEASE] Bump main branch to 1.25.0-dev (#3759) diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h index cb841a749e..2bb4ab6542 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h @@ -36,11 +36,11 @@ struct OPENTELEMETRY_EXPORT OtlpGrpcExporterOptions : public OtlpGrpcClientOptio ~OtlpGrpcExporterOptions() override; /** Collection Limits. No limit by default. */ - std::uint32_t max_attributes = std::numeric_limits::max(); - std::uint32_t max_events = std::numeric_limits::max(); - std::uint32_t max_links = std::numeric_limits::max(); - std::uint32_t max_attributes_per_event = std::numeric_limits::max(); - std::uint32_t max_attributes_per_link = std::numeric_limits::max(); + std::uint32_t max_attributes = (std::numeric_limits::max)(); + std::uint32_t max_events = (std::numeric_limits::max)(); + std::uint32_t max_links = (std::numeric_limits::max)(); + std::uint32_t max_attributes_per_event = (std::numeric_limits::max)(); + std::uint32_t max_attributes_per_link = (std::numeric_limits::max)(); }; } // namespace otlp diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h index 08177e34e7..58fad0485e 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h @@ -128,11 +128,11 @@ struct OPENTELEMETRY_EXPORT OtlpHttpExporterOptions float retry_policy_backoff_multiplier{}; /** Collection Limits. No limit by default. */ - std::uint32_t max_attributes = std::numeric_limits::max(); - std::uint32_t max_events = std::numeric_limits::max(); - std::uint32_t max_links = std::numeric_limits::max(); - std::uint32_t max_attributes_per_event = std::numeric_limits::max(); - std::uint32_t max_attributes_per_link = std::numeric_limits::max(); + std::uint32_t max_attributes = (std::numeric_limits::max)(); + std::uint32_t max_events = (std::numeric_limits::max)(); + std::uint32_t max_links = (std::numeric_limits::max)(); + std::uint32_t max_attributes_per_event = (std::numeric_limits::max)(); + std::uint32_t max_attributes_per_link = (std::numeric_limits::max)(); }; } // namespace otlp diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h index 421de7647a..b63bc5ff7d 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h @@ -38,11 +38,11 @@ class OtlpRecordable final : public opentelemetry::sdk::trace::Recordable { public: explicit OtlpRecordable( - std::uint32_t max_attributes = std::numeric_limits::max(), - std::uint32_t max_events = std::numeric_limits::max(), - std::uint32_t max_links = std::numeric_limits::max(), - std::uint32_t max_attributes_per_event = std::numeric_limits::max(), - std::uint32_t max_attributes_per_link = std::numeric_limits::max()) + std::uint32_t max_attributes = (std::numeric_limits::max)(), + std::uint32_t max_events = (std::numeric_limits::max)(), + std::uint32_t max_links = (std::numeric_limits::max)(), + std::uint32_t max_attributes_per_event = (std::numeric_limits::max)(), + std::uint32_t max_attributes_per_link = (std::numeric_limits::max)()) : max_attributes_(max_attributes), max_events_(max_events), max_links_(max_links),