Skip to content

Commit 6405aea

Browse files
committed
[BUG] Don't wrap #include <Python.h> with extern "C".
This extern block was recently moved, which exposed a latent bug in CPython (python/cpython#127772), but it's probably not a good practice in general to wrap other code's headers with extern guards.
1 parent e7d4081 commit 6405aea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

numpy/_core/include/numpy/ndarraytypes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_
22
#define NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_
33

4-
#ifdef __cplusplus
5-
extern "C" {
6-
#endif
7-
84
#include "npy_common.h"
95
#include "npy_endian.h"
106
#include "npy_cpu.h"
117
#include "utils.h"
128

9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
1313
#define NPY_NO_EXPORT NPY_VISIBILITY_HIDDEN
1414

1515
/* Always allow threading unless it was explicitly disabled at build time */

0 commit comments

Comments
 (0)