summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2021-01-14 15:15:53 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2021-09-10 20:00:06 +0900
commit13be4c0342951131f89272097f3796332f5d89ad (patch)
tree0a8a170bff4b6f2500a1139002518bbe67dbb0f4
parent28b7b0e13e261006dee4b4d9152aaabdb1286718 (diff)
downloadruby-13be4c0342951131f89272097f3796332f5d89ad.tar.gz
include/ruby/internal/warning_push.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
-rw-r--r--include/ruby/internal/warning_push.h39
1 files changed, 36 insertions, 3 deletions
diff --git a/include/ruby/internal/warning_push.h b/include/ruby/internal/warning_push.h
index 053659875d..f5981633f8 100644
--- a/include/ruby/internal/warning_push.h
+++ b/include/ruby/internal/warning_push.h
@@ -18,8 +18,7 @@
* 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
+ * @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))