ruby-changes:67710
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 10 Sep 2021 20:00:46 +0900 (JST)
Subject: [ruby-changes:67710] 13be4c0342 (master): include/ruby/internal/warning_push.h: add doxygen
https://git.ruby-lang.org/ruby.git/commit/?id=13be4c0342 From 13be4c0342951131f89272097f3796332f5d89ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Thu, 14 Jan 2021 15:15:53 +0900 Subject: include/ruby/internal/warning_push.h: add doxygen Must not be a bad idea to improve documents. [ci skip] --- include/ruby/internal/warning_push.h | 39 +++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/include/ruby/internal/warning_push.h b/include/ruby/internal/warning_push.h index 0536598..f598163 100644 --- a/include/ruby/internal/warning_push.h +++ b/include/ruby/internal/warning_push.h @@ -18,8 +18,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/warning_push.h#L18 * 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 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/warning_push.h#L45 #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)) -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/