зеркало из https://github.com/github/ruby.git
_Static_assert is a C11ism
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
db5d556f9b
Коммит
8ebe5da2b3
|
@ -79,8 +79,10 @@ extern "C" {
|
||||||
# define __has_extension __has_feature
|
# define __has_extension __has_feature
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
|
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
||||||
# define STATIC_ASSERT(name, expr) _Static_assert(expr, #name ": " #expr)
|
# define STATIC_ASSERT(name, expr) _Static_assert(expr, #name ": " #expr)
|
||||||
|
#elif GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
|
||||||
|
# define STATIC_ASSERT(name, expr) RB_GNUC_EXTENSION _Static_assert(expr, #name ": " #expr)
|
||||||
#else
|
#else
|
||||||
# define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
|
# define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче