From 7e3fd46c735e254d6d1480212861c19a99ee836a Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 12 Feb 2026 22:03:57 +0100 Subject: [PATCH 1/2] [BUILD] Avoid break caused by max() macro on windows --- .../exporters/otlp/otlp_grpc_exporter_options.h | 10 +++++----- .../exporters/otlp/otlp_http_exporter_options.h | 10 +++++----- .../opentelemetry/exporters/otlp/otlp_recordable.h | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) 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), From f68cedd3e036b61cc2e6ca6a068a0c84351f7a0c Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 12 Feb 2026 22:13:38 +0100 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) 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)