From 616abe865dc7606b4325e1e44fff587c83ad1de7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 30 Dec 2018 11:34:04 +0100 Subject: [PATCH] shared/trivial: add comment about compat macro _NM_CC_SUPPORT_GENERIC w.r.t. C11 C11 provides _Generic(). Until now we used it when the compiler supports it (in extended --std=gnu99 mode). In practice, now that we require C11 it should always be present. We will drop compatibility code in the future. For now, just add a comment and keep it. The reason is, that "shared/nm-utils/nm-macros-internal.h" may be used by VPN plugins or applet, which may or may not yet bump to C11. Keeping it for now, allows for an easier update. --- shared/nm-utils/nm-macros-internal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h index 946864d08b..7cebd56cc0 100644 --- a/shared/nm-utils/nm-macros-internal.h +++ b/shared/nm-utils/nm-macros-internal.h @@ -460,6 +460,10 @@ NM_G_ERROR_MSG (GError *error) #endif #ifndef _NM_CC_SUPPORT_GENERIC +/* In the meantime, NetworkManager requires C11 and _Generic() should always be available. + * However, shared/nm-utils may also be used in VPN/applet, which possibly did not yet + * bump the C standard requirement. Leave this for the moment, but eventually we can + * drop it. */ #if (defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9 ))) || (defined (__clang__)) #define _NM_CC_SUPPORT_GENERIC 1 #else