mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx: add __fallthrough workaround for LCC.
Related to https://bugs.mcst.ru/bugzilla/show_bug.cgi?id=5093
This commit is contained in:
parent
eec7b87288
commit
505ee31635
23
src/defs.h
23
src/defs.h
@ -67,6 +67,10 @@
|
|||||||
# define __has_include(x) (0)
|
# define __has_include(x) (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __has_cpp_attribute
|
||||||
|
# define __has_cpp_attribute(x) (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __has_feature(thread_sanitizer)
|
#if __has_feature(thread_sanitizer)
|
||||||
# define __SANITIZE_THREAD__ 1
|
# define __SANITIZE_THREAD__ 1
|
||||||
#endif
|
#endif
|
||||||
@ -144,11 +148,20 @@
|
|||||||
#endif /* __noop */
|
#endif /* __noop */
|
||||||
|
|
||||||
#ifndef __fallthrough
|
#ifndef __fallthrough
|
||||||
# if __GNUC_PREREQ(7, 0) || __has_attribute(__fallthrough__)
|
# if defined(__cplusplus) && __has_cpp_attribute(fallthrough)
|
||||||
# define __fallthrough __attribute__((__fallthrough__))
|
# define __fallthrough [[fallthrough]]
|
||||||
# else
|
# elif __GNUC_PREREQ(8, 0) && defined(__cplusplus) && __cplusplus >= 201103L
|
||||||
# define __fallthrough __noop()
|
# define __fallthrough [[fallthrough]]
|
||||||
# endif
|
# 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
|
||||||
|
# endif
|
||||||
#endif /* __fallthrough */
|
#endif /* __fallthrough */
|
||||||
|
|
||||||
#ifndef __unreachable
|
#ifndef __unreachable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user