Merge "Annotate fallthrough in OEC Testbed" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
640e8727dc
@@ -5,20 +5,27 @@
|
|||||||
#ifndef WVCDM_UTIL_UTIL_COMMON_H_
|
#ifndef WVCDM_UTIL_UTIL_COMMON_H_
|
||||||
#define WVCDM_UTIL_UTIL_COMMON_H_
|
#define WVCDM_UTIL_UTIL_COMMON_H_
|
||||||
|
|
||||||
|
// This section deals with defines that are platform-specific.
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
# ifdef CORE_UTIL_IMPLEMENTATION
|
# ifdef CORE_UTIL_IMPLEMENTATION
|
||||||
# define CORE_UTIL_EXPORT __declspec(dllexport)
|
# define CORE_UTIL_EXPORT __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define CORE_UTIL_EXPORT __declspec(dllimport)
|
# define CORE_UTIL_EXPORT __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# define CORE_UTIL_IGNORE_DEPRECATED
|
# define CORE_UTIL_IGNORE_DEPRECATED
|
||||||
# define CORE_UTIL_RESTORE_WARNINGS
|
# define CORE_UTIL_RESTORE_WARNINGS
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# ifdef CORE_UTIL_IMPLEMENTATION
|
# ifdef CORE_UTIL_IMPLEMENTATION
|
||||||
# define CORE_UTIL_EXPORT __attribute__((visibility("default")))
|
# define CORE_UTIL_EXPORT __attribute__((visibility("default")))
|
||||||
# else
|
# else
|
||||||
# define CORE_UTIL_EXPORT
|
# define CORE_UTIL_EXPORT
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
# define CORE_UTIL_IGNORE_DEPRECATED \
|
# define CORE_UTIL_IGNORE_DEPRECATED \
|
||||||
_Pragma("GCC diagnostic push") \
|
_Pragma("GCC diagnostic push") \
|
||||||
@@ -28,6 +35,23 @@
|
|||||||
# define CORE_UTIL_IGNORE_DEPRECATED
|
# define CORE_UTIL_IGNORE_DEPRECATED
|
||||||
# define CORE_UTIL_RESTORE_WARNINGS
|
# define CORE_UTIL_RESTORE_WARNINGS
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// This section deals with attribute-detection and is platform-agnostic.
|
||||||
|
|
||||||
|
#if !defined(__has_cpp_attribute)
|
||||||
|
# define __has_cpp_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __has_cpp_attribute(fallthrough)
|
||||||
|
# define CORE_UTIL_FALLTHROUGH [[fallthrough]]
|
||||||
|
#elif __has_cpp_attribute(clang::fallthrough)
|
||||||
|
# define CORE_UTIL_FALLTHROUGH [[clang::fallthrough]]
|
||||||
|
#elif __has_cpp_attribute(gnu::fallthrough)
|
||||||
|
# define CORE_UTIL_FALLTHROUGH [[gnu::fallthrough]]
|
||||||
|
#else
|
||||||
|
# define CORE_UTIL_FALLTHROUGH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // WVCDM_UTIL_UTIL_COMMON_H_
|
#endif // WVCDM_UTIL_UTIL_COMMON_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user