headers: crt: Improve _Pragma support and add helper macros
Previously, __MINGW_PRAGMA_PARAM only resolves to _Pragma under GCC 4.4
and later, which means Clang and other compilers that support _Pragma
resolves it to empty, thus it was seldom used before.
This commit improves the detection of _Pragma support by first checking
for C++11 and C99 support, and then checking for GCC 3.0 and later,
which is the first documented version that supports _Pragma. Since Clang
always pretends to be GCC 4.2, and most other compilers also pretend to
be GCC 3.0+, __MINGW_PRAGMA_PARAM can now be safely used in most cases.
Also added _CRT_BEGIN_C_HEADER and _CRT_END_C_HEADER macros similar to
those in MSVC's corecrt.h, so that we no longer have to write #ifdef
__cplusplus in every header.
Signed-off-by: Zhongteng Gui <dragon-archer@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
1 file changed