Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
warning_push.h
Go to the documentation of this file.
1#ifndef RBIMPL_WARNING_PUSH_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_WARNING_PUSH_H
48
49#if RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0)
50# /* Not sure exactly when but it seems VC++ 6.0 is a version with it.*/
51# define RBIMPL_WARNING_PUSH() __pragma(warning(push))
52# define RBIMPL_WARNING_POP() __pragma(warning(pop))
53# define RBIMPL_WARNING_ERROR(flag) __pragma(warning(error: flag))
54# define RBIMPL_WARNING_IGNORED(flag) __pragma(warning(disable: flag))
55
56#elif RBIMPL_COMPILER_SINCE(Intel, 13, 0, 0)
57# define RBIMPL_WARNING_PUSH() __pragma(warning(push))
58# define RBIMPL_WARNING_POP() __pragma(warning(pop))
59# define RBIMPL_WARNING_ERROR(flag) __pragma(warning(error: flag))
60# define RBIMPL_WARNING_IGNORED(flag) __pragma(warning(disable: flag))
61
62#elif RBIMPL_COMPILER_IS(Clang) || RBIMPL_COMPILER_IS(Apple)
63# /* Not sure exactly when but it seems LLVM 2.6.0 is a version with it. */
64# define RBIMPL_WARNING_PRAGMA0(x) _Pragma(# x)
65# define RBIMPL_WARNING_PRAGMA1(x) RBIMPL_WARNING_PRAGMA0(clang diagnostic x)
66# define RBIMPL_WARNING_PRAGMA2(x, y) RBIMPL_WARNING_PRAGMA1(x # y)
67# define RBIMPL_WARNING_PUSH() RBIMPL_WARNING_PRAGMA1(push)
68# define RBIMPL_WARNING_POP() RBIMPL_WARNING_PRAGMA1(pop)
69# define RBIMPL_WARNING_ERROR(flag) RBIMPL_WARNING_PRAGMA2(error, flag)
70# define RBIMPL_WARNING_IGNORED(flag) RBIMPL_WARNING_PRAGMA2(ignored, flag)
71
72#elif RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
73# /* https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Diagnostic-Pragmas.html */
74# define RBIMPL_WARNING_PRAGMA0(x) _Pragma(# x)
75# define RBIMPL_WARNING_PRAGMA1(x) RBIMPL_WARNING_PRAGMA0(GCC diagnostic x)
76# define RBIMPL_WARNING_PRAGMA2(x, y) RBIMPL_WARNING_PRAGMA1(x # y)
77# define RBIMPL_WARNING_PUSH() RBIMPL_WARNING_PRAGMA1(push)
78# define RBIMPL_WARNING_POP() RBIMPL_WARNING_PRAGMA1(pop)
79# define RBIMPL_WARNING_ERROR(flag) RBIMPL_WARNING_PRAGMA2(error, flag)
80# define RBIMPL_WARNING_IGNORED(flag) RBIMPL_WARNING_PRAGMA2(ignored, flag)
81
82#else
83# /* :FIXME: improve here */
84# define RBIMPL_WARNING_PUSH() /* void */
85# define RBIMPL_WARNING_POP() /* void */
86# define RBIMPL_WARNING_ERROR(flag) /* void */
87# define RBIMPL_WARNING_IGNORED(flag) /* void */
88#endif /* _MSC_VER */
91#endif /* RBIMPL_WARNING_PUSH_H */
Defines RBIMPL_COMPILER_IS.
Defines RBIMPL_COMPILER_SINCE.