commit d23d576a9d96f23c58b529d803053333ac127918 parent 5c8b26d06ff67f580c9d0449bf697cba50d87a43 Author: jatin <jatinchowdhury18@gmail.com> Date: Mon, 10 Jul 2023 14:12:10 -0700 Add MSVC bypass for getting C++ version macro Diffstat:
M | include/clap/private/macros.h | | | 14 | +++++++++++--- |
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/clap/private/macros.h b/include/clap/private/macros.h @@ -25,20 +25,28 @@ # endif #endif -#if defined(__cplusplus) && __cplusplus >= 201103L +#if defined(__cplusplus) +# if MSVC +# define CLAP_CPLUSPLUS _MSVC_LANG +# else +# define CLAP_CPLUSPLUS __cplusplus +# endif +#endif + +#if defined(CLAP_CPLUSPLUS) && CLAP_CPLUSPLUS >= 201103L # define CLAP_HAS_CXX11 # define CLAP_CONSTEXPR constexpr #else # define CLAP_CONSTEXPR #endif -#if defined(__cplusplus) && __cplusplus >= 201703L +#if defined(CLAP_CPLUSPLUS) && CLAP_CPLUSPLUS >= 201703L # define CLAP_HAS_CXX17 # define CLAP_NODISCARD [[nodiscard]] #else # define CLAP_NODISCARD #endif -#if defined(__cplusplus) && __cplusplus >= 202002L +#if defined(CLAP_CPLUSPLUS) && CLAP_CPLUSPLUS >= 202002L # define CLAP_HAS_CXX20 #endif