diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 585bacaf82..cab8368c87 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -1,16 +1,19 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#if !SD_BOOT -# include -#endif - #include #include #include #include #include +/* This header unconditionally defines MAX() so include it here already so + * it won't override our own definition of MAX() that we define later in this + * file. */ +#if !SD_BOOT +#include +#endif + /* Temporarily disable some warnings */ #define DISABLE_WARNING_DEPRECATED_DECLARATIONS \ _Pragma("GCC diagnostic push"); \ @@ -144,11 +147,7 @@ #define XCONCATENATE(x, y) x ## y #define CONCATENATE(x, y) XCONCATENATE(x, y) -#if SD_BOOT - #define static_assert _Static_assert -#endif - -#define assert_cc(expr) static_assert(expr, #expr) +#define assert_cc(expr) _Static_assert(expr, #expr) #define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq)) #define UNIQ __COUNTER__