summaryrefslogtreecommitdiff
path: root/include/ruby/internal/warning_push.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/internal/warning_push.h')
-rw-r--r--include/ruby/internal/warning_push.h41
1 files changed, 37 insertions, 4 deletions
diff --git a/include/ruby/internal/warning_push.h b/include/ruby/internal/warning_push.h
index ca521290c9..f5981633f8 100644
--- a/include/ruby/internal/warning_push.h
+++ b/include/ruby/internal/warning_push.h
@@ -17,9 +17,8 @@
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
- * extension libraries. They could be written in C++98.
- * @brief Defines RBIMPL_WARNING_PUSH.
- * @cond INTERNAL_MACRO
+ * extension libraries. They could be written in C++98.
+ * @brief Defines #RBIMPL_WARNING_PUSH.
*
* ### Q&A ###
*
@@ -46,7 +45,41 @@
#include "ruby/internal/compiler_is.h"
#include "ruby/internal/compiler_since.h"
-#if RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0)
+#if defined(__DOXYGEN__)
+
+/**
+ * @private
+ *
+ * Pushes compiler warning state.
+ */
+#define RBIMPL_WARNING_PUSH() __pragma(warning(push))
+
+/**
+ * @private
+ *
+ * Pops compiler warning state.
+ */
+#define RBIMPL_WARNING_POP() __pragma(warning(pop))
+
+/**
+ * @private
+ *
+ * Turns a warning into a fatal error.
+ *
+ * @param flag A flag that represents the kind of warnings.
+ */
+#define RBIMPL_WARNING_ERROR(flag) __pragma(warning(error: flag))
+
+/**
+ * @private
+ *
+ * Suppresses a warning.
+ *
+ * @param flag A flag that represents the kind of warnings.
+ */
+#define RBIMPL_WARNING_IGNORED(flag) __pragma(warning(disable: flag))
+
+#elif RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0)
# /* Not sure exactly when but it seems VC++ 6.0 is a version with it.*/
# define RBIMPL_WARNING_PUSH() __pragma(warning(push))
# define RBIMPL_WARNING_POP() __pragma(warning(pop))