Skip to content

Commit

Permalink
MAINT: Don't wrap #include <Python.h> with extern "C"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hawkinsp authored and charris committed Dec 12, 2024
1 parent cab0484 commit 531565c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions numpy/_core/include/numpy/ndarraytypes.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_
#define NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "npy_common.h"
#include "npy_endian.h"
#include "npy_cpu.h"
#include "utils.h"

#ifdef __cplusplus
extern "C" {
#endif

#define NPY_NO_EXPORT NPY_VISIBILITY_HIDDEN

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

0 comments on commit 531565c

Please sign in to comment.