Skip to content

Commit

Permalink
Some GCC versions do not support pragmas within expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
terryburton committed Oct 13, 2024
1 parent 49366d3 commit 183a171
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/gs1syntaxdictionary.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 183a171

Please sign in to comment.