Skip to content

Commit 49cc2f8

Browse files
committed
Add definitions for PY_CXX_CONSTEXPR, PY_CXX_CONSTEVAL, and PY_CXX_CONSTINIT
1 parent 96ab379 commit 49cc2f8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Include/pyport.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,30 @@ extern "C" {
642642
# endif
643643
#endif
644644

645+
#ifndef PY_CXX_CONSTEXPR
646+
# if defined(__cplusplus) || __STDC_VERSION__ >= 202311L
647+
# define PY_CXX_CONSTEXPR constexpr
648+
# else
649+
# define PY_CXX_CONSTEXPR
650+
# endif
651+
#endif
652+
653+
#ifndef PY_CXX_CONSTEVAL
654+
# ifdef __cpp_consteval
655+
# define PY_CXX_CONSTEVAL consteval
656+
# else
657+
# define PY_CXX_CONSTEVAL
658+
# endif
659+
#endif
660+
661+
#ifndef PY_CXX_CONSTINIT
662+
# ifdef __cpp_constinit
663+
# define PY_CXX_CONSTINIT constinit
664+
# else
665+
# define PY_CXX_CONSTINIT
666+
# endif
667+
#endif
668+
645669
#if defined(__sgi) && !defined(_SGI_MP_SOURCE)
646670
# define _SGI_MP_SOURCE
647671
#endif

0 commit comments

Comments
 (0)