Skip to content

Commit

Permalink
Move PYBIND11_CONSTINIT to detail/common.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Oct 9, 2023
1 parent a864f21 commit 6689b06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@
# endif
#endif

#ifndef PYBIND11_CONSTINIT
# ifdef PYBIND11_CPP20
# define PYBIND11_CONSTINIT constinit
# else
# define PYBIND11_CONSTINIT
# endif
#endif

// Compiler version assertions
#if defined(__INTEL_COMPILER)
# if __INTEL_COMPILER < 1800
Expand Down
8 changes: 0 additions & 8 deletions include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ class array; // Forward declaration

PYBIND11_NAMESPACE_BEGIN(detail)

#ifndef PYBIND11_CONSTINIT
# if __cplusplus >= 202002L
# define PYBIND11_CONSTINIT constinit
# else
# define PYBIND11_CONSTINIT
# endif
#endif

// Main author of this class: jbms@
template <typename T>
class LazyInitializeAtLeastOnceDestroyNever {
Expand Down

0 comments on commit 6689b06

Please sign in to comment.