1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

include/ruby/internal/warning_push.h: add doxygen

Must not be a bad idea to improve documents. [ci skip]
This commit is contained in:
卜部昌平 2021-01-14 15:15:53 +09:00
parent 28b7b0e13e
commit 13be4c0342
Notes: git 2021-09-10 20:01:55 +09:00

View file

@ -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))