From: Daan De Meyer Date: Fri, 18 Apr 2025 09:50:18 +0000 (+0200) Subject: fundamental: Always use _Static_assert for assert_cc() X-Git-Tag: v258-rc1~780^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c68eb22064f7ac889f2bf94347187bf945c50a1d;p=thirdparty%2Fsystemd.git fundamental: Always use _Static_assert for assert_cc() Let's get rid of the assert.h include in macro-fundamental.h by always using the builtin. Behavior is unchanged. --- diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 585bacaf821..cab8368c871 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__