From 652c7f8ebbcdfbc8a2e9b2296d35ac8042835adf Mon Sep 17 00:00:00 2001 From: Hans Dembinski Date: Mon, 26 Dec 2022 12:14:05 +0100 Subject: [PATCH] try to catch for illegal min,max macros (#381) --- test/odr_test.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/odr_test.cpp b/test/odr_test.cpp index 13b108bc..ae9a0dbd 100644 --- a/test/odr_test.cpp +++ b/test/odr_test.cpp @@ -4,11 +4,13 @@ // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) -// The header windows.h and possibly others illegially do the following -#define small char +// The header windows.h and possibly others illegially use unprotected defines +#define small macro_substitution_this_shouldn_t_be_happening +#define min(A, B) macro_substitution_this_shouldn_t_be_happening +#define max(A, B) macro_substitution_this_shouldn_t_be_happening // which violates the C++ standard. We make sure here that including our headers work -// nevertheless by avoiding the preprocessing token `small`. For more details, see -// https://github.com/boostorg/histogram/issues/342 +// nevertheless by avoiding these preprocessing tokens or by preventing their macro +// substitution. For more details, see https://github.com/boostorg/histogram/issues/342 // include all Boost.Histogram header here; see odr_main_test.cpp for details #include