mirror of https://github.com/AxioDL/logvisor.git
Use __has_cpp_attribute for NOWIDE_FALLTHROUGH
This commit is contained in:
parent
6eadd55f7a
commit
4f7f3f2147
|
@ -58,8 +58,14 @@
|
||||||
#define NOWIDE_USE_FILEBUF_REPLACEMENT 0
|
#define NOWIDE_USE_FILEBUF_REPLACEMENT 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 7
|
#if defined(__has_cpp_attribute)
|
||||||
#define NOWIDE_FALLTHROUGH __attribute__((fallthrough))
|
#define NOWIDE_HAS_CPP_ATTRIBUTE(attr) __has_cpp_attribute(attr)
|
||||||
|
#else
|
||||||
|
#define NOWIDE_HAS_CPP_ATTRIBUTE(attr) (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if NOWIDE_HAS_CPP_ATTRIBUTE(fallthrough)
|
||||||
|
#define NOWIDE_FALLTHROUGH [[fallthrough]]
|
||||||
#else
|
#else
|
||||||
#define NOWIDE_FALLTHROUGH
|
#define NOWIDE_FALLTHROUGH
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue