Skip to content

Commit 265b9bc

Browse files
Avoid duplicate definitions.
1 parent 4c56995 commit 265b9bc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/pybind11/detail/non_limited_api.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
#include <dlfcn.h> // `dladdr` and friends.
1616
#endif
1717

18-
#ifdef Py_LIMITED_API
18+
#if !defined(PYBIND11_NONLIMITEDAPI_ONCE) && defined(Py_LIMITED_API)
19+
#define PYBIND11_NONLIMITEDAPI_ONCE
1920
typedef struct _heaptypeobject PyHeapTypeObject;
2021
typedef struct _typeobject PyTypeObject;
21-
typedef struct { double real; double imag; } Py_complex;
2222
typedef struct PyConfig PyConfig;
23+
typedef struct { double real; double imag; } Py_complex;
2324

2425
// We must not use this in our own API below, because the definitions are different in different Python versions.
2526
// Instead we provide our own type `Py_buffer_` below for use in our own API.

0 commit comments

Comments
 (0)