headers/_mingw: Add macros for conditional constexpr

Signed-off-by: LIU Hao <lh_mouse@126.com>
This commit is contained in:
LIU Hao 2024-11-11 23:59:26 +08:00
parent a0f68282b1
commit 65cd305b26

View File

@ -97,6 +97,20 @@ limitations in handling dllimport attribute. */
#endif
#endif
/* Recent MSVC supports C++14 but it doesn't define __cplusplus accordingly. */
#define __MINGW_CXX11_CONSTEXPR
#define __MINGW_CXX14_CONSTEXPR
#ifdef __cplusplus
# if __cplusplus >= 201103L || defined(_MSC_VER)
# undef __MINGW_CXX11_CONSTEXPR
# define __MINGW_CXX11_CONSTEXPR constexpr
# endif
# if __cplusplus >= 201402L || defined(_MSC_VER)
# undef __MINGW_CXX14_CONSTEXPR
# define __MINGW_CXX14_CONSTEXPR constexpr
# endif
#endif
#ifdef __cplusplus
# define __UNUSED_PARAM(x)
#else