mdbx: add __fallthrough workaround for LCC.

Related to https://bugs.mcst.ru/bugzilla/show_bug.cgi?id=5093
This commit is contained in:
Leonid Yuriev 2020-06-26 02:38:24 +03:00
parent eec7b87288
commit 505ee31635

View File

@ -67,6 +67,10 @@
# define __has_include(x) (0)
#endif
#ifndef __has_cpp_attribute
# define __has_cpp_attribute(x) (0)
#endif
#if __has_feature(thread_sanitizer)
# define __SANITIZE_THREAD__ 1
#endif
@ -144,10 +148,19 @@
#endif /* __noop */
#ifndef __fallthrough
# if __GNUC_PREREQ(7, 0) || __has_attribute(__fallthrough__)
# if defined(__cplusplus) && __has_cpp_attribute(fallthrough)
# define __fallthrough [[fallthrough]]
# elif __GNUC_PREREQ(8, 0) && defined(__cplusplus) && __cplusplus >= 201103L
# define __fallthrough [[fallthrough]]
# elif __GNUC_PREREQ(7, 0) && \
(!defined(__LCC__) || (__LCC__ == 124 && __LCC_MINOR__ >= 12) || \
(__LCC__ == 125 && __LCC_MINOR__ >= 5) || (__LCC__ >= 126))
# define __fallthrough __attribute__((__fallthrough__))
# elif defined(__clang__) && defined(__cplusplus) && __cplusplus >= 201103L &&\
__has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
# define __fallthrough [[clang::fallthrough]]
# else
# define __fallthrough __noop()
# define __fallthrough
# endif
#endif /* __fallthrough */