nemequ / hedley

A C/C++ header to help move #ifdefs out of your code
https://nemequ.github.io/hedley/
Creative Commons Zero v1.0 Universal
774 stars 51 forks source link

HEDLEY_FLAGS fallback #37

Closed mattyclarkson closed 4 years ago

mattyclarkson commented 4 years ago
#if HEDLEY_HAS_ATTRIBUTE(flag_enum)
#  define HEDLEY_FLAGS __attribute__((__flag_enum__))
#endif

When HEDLEY_HAS_ATTRIBUTE(flag_enum) is false we should provide a fallback for compilers that do not support the attribute.

#if HEDLEY_HAS_ATTRIBUTE(flag_enum)
#  define HEDLEY_FLAGS __attribute__((__flag_enum__))
#else
#  define HEDLEY_FLAGS
#endif
nemequ commented 4 years ago

Oops! Thanks for reporting this.

I'm rather surprised CI didn't catch this… Anyways, I've pushed a fix to the dev branch, it will be included in the next release.

If you need a temporary workaround in your code, you could always just do

#if !defined(HEDLEY_FLAGS)
#  define HEDLEY_FLAGS
#endif