From 183a171c30bf2de6d5c6d5c1a2e88deed507dc8e Mon Sep 17 00:00:00 2001 From: Terry Burton Date: Sun, 13 Oct 2024 19:49:31 +0100 Subject: [PATCH] Some GCC versions do not support pragmas within expressions --- src/gs1syntaxdictionary.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gs1syntaxdictionary.c b/src/gs1syntaxdictionary.c index 3101ed3..6745c11 100644 --- a/src/gs1syntaxdictionary.c +++ b/src/gs1syntaxdictionary.c @@ -34,6 +34,15 @@ DIAG_PUSH \ DIAG_DISABLE_DEPRECATED_DECLARATIONS \ ENT(x) \ DIAG_POP + +/* GCC has flaky support for pragmas within expressions */ +#if defined(__GNUC__) && !defined(__clang__) + #undef DEP + #define DEP(x) ENT(x) + DIAG_PUSH + DIAG_DISABLE_DEPRECATED_DECLARATIONS +#endif + const struct name_function_s name_function_map[] = { ENT(couponcode), ENT(couponposoffer), @@ -78,6 +87,12 @@ const struct name_function_s name_function_map[] = { ENT(yyyymmdd), ENT(zero), }; + +/* Flaky GCC */ +#if defined(__GNUC__) && !defined(__clang__) + DIAG_POP +#endif + #undef ENT #undef DEP