summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-09-08 11:06:35 -0600
committerGitHub <noreply@github.com>2021-09-08 11:06:35 -0600
commit5d0479804d1ce352891738c82a5cd2051bbdfbde (patch)
treef46e32985e7f9eeb32868907d5be6fc0cf392f4a
parent3de252be1215c0f9bc0a2f5c3aebdd7ffc86e410 (diff)
parent6dff0c2f22b58b1d5d397fd8c4ab768a30d10499 (diff)
downloadnumpy-5d0479804d1ce352891738c82a5cd2051bbdfbde.tar.gz
Merge pull request #19826 from charris/cleanup-header-guards
MAINT: Standardize guards in numpy/core/include
-rw-r--r--numpy/core/include/numpy/_neighborhood_iterator_imp.h2
-rw-r--r--numpy/core/include/numpy/arrayobject.h5
-rw-r--r--numpy/core/include/numpy/arrayscalars.h6
-rw-r--r--numpy/core/include/numpy/halffloat.h6
-rw-r--r--numpy/core/include/numpy/libdivide/libdivide.h10
-rw-r--r--numpy/core/include/numpy/ndarrayobject.h6
-rw-r--r--numpy/core/include/numpy/ndarraytypes.h12
-rw-r--r--numpy/core/include/numpy/noprefix.h6
-rw-r--r--numpy/core/include/numpy/npy_1_7_deprecated_api.h8
-rw-r--r--numpy/core/include/numpy/npy_3kcompat.h6
-rw-r--r--numpy/core/include/numpy/npy_common.h6
-rw-r--r--numpy/core/include/numpy/npy_cpu.h8
-rw-r--r--numpy/core/include/numpy/npy_endian.h9
-rw-r--r--numpy/core/include/numpy/npy_interrupt.h10
-rw-r--r--numpy/core/include/numpy/npy_math.h6
-rw-r--r--numpy/core/include/numpy/npy_no_deprecated_api.h7
-rw-r--r--numpy/core/include/numpy/npy_os.h6
-rw-r--r--numpy/core/include/numpy/numpyconfig.h6
-rw-r--r--numpy/core/include/numpy/old_defines.h6
-rw-r--r--numpy/core/include/numpy/oldnumeric.h7
-rw-r--r--numpy/core/include/numpy/random/bitgen.h6
-rw-r--r--numpy/core/include/numpy/random/distributions.h6
-rw-r--r--numpy/core/include/numpy/ufuncobject.h8
-rw-r--r--numpy/core/include/numpy/utils.h6
24 files changed, 89 insertions, 75 deletions
diff --git a/numpy/core/include/numpy/_neighborhood_iterator_imp.h b/numpy/core/include/numpy/_neighborhood_iterator_imp.h
index e8860cbc7..07e2363d0 100644
--- a/numpy/core/include/numpy/_neighborhood_iterator_imp.h
+++ b/numpy/core/include/numpy/_neighborhood_iterator_imp.h
@@ -1,4 +1,4 @@
-#ifndef _NPY_INCLUDE_NEIGHBORHOOD_IMP
+#ifndef NUMPY_CORE_INCLUDE_NUMPY__NEIGHBORHOOD_IMP_H_
#error You should not include this header directly
#endif
/*
diff --git a/numpy/core/include/numpy/arrayobject.h b/numpy/core/include/numpy/arrayobject.h
index 4f46d6b1a..da47bb096 100644
--- a/numpy/core/include/numpy/arrayobject.h
+++ b/numpy/core/include/numpy/arrayobject.h
@@ -1,4 +1,5 @@
-#ifndef Py_ARRAYOBJECT_H
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_
#define Py_ARRAYOBJECT_H
#include "ndarrayobject.h"
@@ -8,4 +9,4 @@
#include "noprefix.h"
#endif
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_ */
diff --git a/numpy/core/include/numpy/arrayscalars.h b/numpy/core/include/numpy/arrayscalars.h
index 14a31988f..a20a68016 100644
--- a/numpy/core/include/numpy/arrayscalars.h
+++ b/numpy/core/include/numpy/arrayscalars.h
@@ -1,5 +1,5 @@
-#ifndef _NPY_ARRAYSCALARS_H_
-#define _NPY_ARRAYSCALARS_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_
#ifndef _MULTIARRAYMODULE
typedef struct {
@@ -179,4 +179,4 @@ typedef struct {
#define PyArrayScalar_ASSIGN(obj, cls, val) \
PyArrayScalar_VAL(obj, cls) = val
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_ */
diff --git a/numpy/core/include/numpy/halffloat.h b/numpy/core/include/numpy/halffloat.h
index ab0d221fb..950401664 100644
--- a/numpy/core/include/numpy/halffloat.h
+++ b/numpy/core/include/numpy/halffloat.h
@@ -1,5 +1,5 @@
-#ifndef __NPY_HALFFLOAT_H__
-#define __NPY_HALFFLOAT_H__
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_
#include <Python.h>
#include <numpy/npy_math.h>
@@ -67,4 +67,4 @@ npy_uint64 npy_halfbits_to_doublebits(npy_uint16 h);
}
#endif
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_ */
diff --git a/numpy/core/include/numpy/libdivide/libdivide.h b/numpy/core/include/numpy/libdivide/libdivide.h
index 81057b7b4..f4eb8039b 100644
--- a/numpy/core/include/numpy/libdivide/libdivide.h
+++ b/numpy/core/include/numpy/libdivide/libdivide.h
@@ -8,8 +8,8 @@
// You may use libdivide under the terms of either of these.
// See LICENSE.txt for more details.
-#ifndef LIBDIVIDE_H
-#define LIBDIVIDE_H
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_LIBDIVIDE_LIBDIVIDE_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_LIBDIVIDE_LIBDIVIDE_H_
#define LIBDIVIDE_VERSION "3.0"
#define LIBDIVIDE_VERSION_MAJOR 3
@@ -2072,8 +2072,8 @@ T& operator/=(T& n, const divider<T, ALGO>& div) {
template <typename T>
using branchfree_divider = divider<T, BRANCHFREE>;
-} // namespace libdivide
+} // namespace libdivide
-#endif // __cplusplus
+#endif // __cplusplus
-#endif // LIBDIVIDE_H
+#endif // NUMPY_CORE_INCLUDE_NUMPY_LIBDIVIDE_LIBDIVIDE_H_
diff --git a/numpy/core/include/numpy/ndarrayobject.h b/numpy/core/include/numpy/ndarrayobject.h
index 5ef1f10aa..2eb951486 100644
--- a/numpy/core/include/numpy/ndarrayobject.h
+++ b/numpy/core/include/numpy/ndarrayobject.h
@@ -1,9 +1,9 @@
/*
* DON'T INCLUDE THIS DIRECTLY.
*/
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NDARRAYOBJECT_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NDARRAYOBJECT_H_
-#ifndef NPY_NDARRAYOBJECT_H
-#define NPY_NDARRAYOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
@@ -265,4 +265,4 @@ PyArray_XDECREF_ERR(PyArrayObject *arr)
#endif
-#endif /* NPY_NDARRAYOBJECT_H */
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NDARRAYOBJECT_H_ */
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index 84441e641..740223882 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -1,5 +1,5 @@
-#ifndef NDARRAYTYPES_H
-#define NDARRAYTYPES_H
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_
#include "npy_common.h"
#include "npy_endian.h"
@@ -1464,9 +1464,11 @@ PyArrayNeighborhoodIter_Next2D(PyArrayNeighborhoodIterObject* iter);
* Include inline implementations - functions defined there are not
* considered public API
*/
-#define _NPY_INCLUDE_NEIGHBORHOOD_IMP
+#define NUMPY_CORE_INCLUDE_NUMPY__NEIGHBORHOOD_IMP_H_
#include "_neighborhood_iterator_imp.h"
-#undef _NPY_INCLUDE_NEIGHBORHOOD_IMP
+#undef NUMPY_CORE_INCLUDE_NUMPY__NEIGHBORHOOD_IMP_H_
+
+
/* The default array type */
#define NPY_DEFAULT_TYPE NPY_DOUBLE
@@ -1951,4 +1953,4 @@ typedef void (PyDataMem_EventHookFunc)(void *inp, void *outp, size_t size,
*/
#undef NPY_DEPRECATED_INCLUDES
-#endif /* NPY_ARRAYTYPES_H */
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_ */
diff --git a/numpy/core/include/numpy/noprefix.h b/numpy/core/include/numpy/noprefix.h
index 041f30192..2c0ce1420 100644
--- a/numpy/core/include/numpy/noprefix.h
+++ b/numpy/core/include/numpy/noprefix.h
@@ -1,5 +1,5 @@
-#ifndef NPY_NOPREFIX_H
-#define NPY_NOPREFIX_H
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NOPREFIX_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NOPREFIX_H_
/*
* You can directly include noprefix.h as a backward
@@ -209,4 +209,4 @@
#define MAX_ELSIZE NPY_MAX_ELSIZE
#endif
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NOPREFIX_H_ */
diff --git a/numpy/core/include/numpy/npy_1_7_deprecated_api.h b/numpy/core/include/numpy/npy_1_7_deprecated_api.h
index a4f90e019..4fd4015a9 100644
--- a/numpy/core/include/numpy/npy_1_7_deprecated_api.h
+++ b/numpy/core/include/numpy/npy_1_7_deprecated_api.h
@@ -1,10 +1,10 @@
-#ifndef _NPY_1_7_DEPRECATED_API_H
-#define _NPY_1_7_DEPRECATED_API_H
-
#ifndef NPY_DEPRECATED_INCLUDES
#error "Should never include npy_*_*_deprecated_api directly."
#endif
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_1_7_DEPRECATED_API_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_1_7_DEPRECATED_API_H_
+
/* Emit a warning if the user did not specifically request the old API */
#ifndef NPY_NO_DEPRECATED_API
#if defined(_WIN32)
@@ -122,4 +122,4 @@
*/
#include "old_defines.h"
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_1_7_DEPRECATED_API_H_ */
diff --git a/numpy/core/include/numpy/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h
index 551ec6be8..22c103e93 100644
--- a/numpy/core/include/numpy/npy_3kcompat.h
+++ b/numpy/core/include/numpy/npy_3kcompat.h
@@ -7,8 +7,8 @@
* strong backwards compatibility guarantees at the moment.
*/
-#ifndef _NPY_3KCOMPAT_H_
-#define _NPY_3KCOMPAT_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_
#include <Python.h>
#include <stdio.h>
@@ -592,4 +592,4 @@ NpyCapsule_Check(PyObject *ptr)
#endif
-#endif /* _NPY_3KCOMPAT_H_ */
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_ */
diff --git a/numpy/core/include/numpy/npy_common.h b/numpy/core/include/numpy/npy_common.h
index d5f329b66..12a3e725a 100644
--- a/numpy/core/include/numpy/npy_common.h
+++ b/numpy/core/include/numpy/npy_common.h
@@ -1,5 +1,5 @@
-#ifndef _NPY_COMMON_H_
-#define _NPY_COMMON_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_
/* need Python.h for npy_intp, npy_uintp */
#include <Python.h>
@@ -1107,4 +1107,4 @@ typedef npy_int64 npy_datetime;
/* End of typedefs for numarray style bit-width names */
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_ */
diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
index e975b0105..78d229e7d 100644
--- a/numpy/core/include/numpy/npy_cpu.h
+++ b/numpy/core/include/numpy/npy_cpu.h
@@ -21,8 +21,8 @@
* NPY_CPU_LOONGARCH
* NPY_CPU_WASM
*/
-#ifndef _NPY_CPUARCH_H_
-#define _NPY_CPUARCH_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_
#include "numpyconfig.h"
@@ -114,7 +114,7 @@
information about your platform (OS, CPU and compiler)
#endif
-/*
+/*
* Except for the following architectures, memory access is limited to the natural
* alignment of data types otherwise it may lead to bus error or performance regression.
* For more details about unaligned access, see https://www.kernel.org/doc/Documentation/unaligned-memory-access.txt.
@@ -126,4 +126,4 @@
#define NPY_ALIGNMENT_REQUIRED 1
#endif
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_ */
diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h
index 620595bec..5e58a7f52 100644
--- a/numpy/core/include/numpy/npy_endian.h
+++ b/numpy/core/include/numpy/npy_endian.h
@@ -1,5 +1,5 @@
-#ifndef _NPY_ENDIAN_H_
-#define _NPY_ENDIAN_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_ENDIAN_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_ENDIAN_H_
/*
* NPY_BYTE_ORDER is set to the same value as BYTE_ORDER set by glibc in
@@ -52,6 +52,7 @@
|| defined(NPY_CPU_LOONGARCH) \
|| defined(NPY_CPU_WASM)
#define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
+
#elif defined(NPY_CPU_PPC) \
|| defined(NPY_CPU_SPARC) \
|| defined(NPY_CPU_S390) \
@@ -66,9 +67,11 @@
|| defined(NPY_CPU_M68K) \
|| defined(NPY_CPU_ARCEB)
#define NPY_BYTE_ORDER NPY_BIG_ENDIAN
+
#else
#error Unknown CPU: can not set endianness
#endif
-#endif
#endif
+
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_ENDIAN_H_ */
diff --git a/numpy/core/include/numpy/npy_interrupt.h b/numpy/core/include/numpy/npy_interrupt.h
index bcb539326..69a0374dd 100644
--- a/numpy/core/include/numpy/npy_interrupt.h
+++ b/numpy/core/include/numpy/npy_interrupt.h
@@ -14,8 +14,8 @@
* https://github.com/python/cpython/pull/20599).
*/
-#ifndef NPY_INTERRUPT_H
-#define NPY_INTERRUPT_H
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_INTERRUPT_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_INTERRUPT_H_
#ifndef NPY_NO_SIGNAL
@@ -46,11 +46,11 @@
PyOS_setsig(SIGINT, _npy_sig_save); \
}
-#else /* NPY_NO_SIGNAL */
+#else /* NPY_NO_SIGNAL */
#define NPY_SIGINT_ON
#define NPY_SIGINT_OFF
-#endif /* HAVE_SIGSETJMP */
+#endif /* HAVE_SIGSETJMP */
-#endif /* NPY_INTERRUPT_H */
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_INTERRUPT_H_ */
diff --git a/numpy/core/include/numpy/npy_math.h b/numpy/core/include/numpy/npy_math.h
index e9a6a30d2..b1e6363e3 100644
--- a/numpy/core/include/numpy/npy_math.h
+++ b/numpy/core/include/numpy/npy_math.h
@@ -1,5 +1,5 @@
-#ifndef __NPY_MATH_C99_H_
-#define __NPY_MATH_C99_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_MATH_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_MATH_H_
#ifdef __cplusplus
extern "C" {
@@ -585,4 +585,4 @@ void npy_set_floatstatus_invalid(void);
#include "npy_math_internal.h"
#endif
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_MATH_H_ */
diff --git a/numpy/core/include/numpy/npy_no_deprecated_api.h b/numpy/core/include/numpy/npy_no_deprecated_api.h
index 6183dc278..39658c0bd 100644
--- a/numpy/core/include/numpy/npy_no_deprecated_api.h
+++ b/numpy/core/include/numpy/npy_no_deprecated_api.h
@@ -9,11 +9,12 @@
#ifndef NPY_NO_DEPRECATED_API
/* put this check here since there may be multiple includes in C extensions. */
-#if defined(NDARRAYTYPES_H) || defined(_NPY_DEPRECATED_API_H) || \
- defined(OLD_DEFINES_H)
+#if defined(NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_) || \
+ defined(NUMPY_CORE_INCLUDE_NUMPY_NPY_DEPRECATED_API_H) || \
+ defined(NUMPY_CORE_INCLUDE_NUMPY_OLD_DEFINES_H_)
#error "npy_no_deprecated_api.h" must be first among numpy includes.
#else
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#endif
-#endif
+#endif /* NPY_NO_DEPRECATED_API */
diff --git a/numpy/core/include/numpy/npy_os.h b/numpy/core/include/numpy/npy_os.h
index 9228c3916..efa0e4012 100644
--- a/numpy/core/include/numpy/npy_os.h
+++ b/numpy/core/include/numpy/npy_os.h
@@ -1,5 +1,5 @@
-#ifndef _NPY_OS_H_
-#define _NPY_OS_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_
#if defined(linux) || defined(__linux) || defined(__linux__)
#define NPY_OS_LINUX
@@ -27,4 +27,4 @@
#define NPY_OS_UNKNOWN
#endif
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_ */
diff --git a/numpy/core/include/numpy/numpyconfig.h b/numpy/core/include/numpy/numpyconfig.h
index 726f1dfac..b2ce66244 100644
--- a/numpy/core/include/numpy/numpyconfig.h
+++ b/numpy/core/include/numpy/numpyconfig.h
@@ -1,5 +1,5 @@
-#ifndef _NPY_NUMPYCONFIG_H_
-#define _NPY_NUMPYCONFIG_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_
#include "_numpyconfig.h"
@@ -45,4 +45,4 @@
#define NPY_1_21_API_VERSION 0x0000000e
#define NPY_1_22_API_VERSION 0x0000000e
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_ */
diff --git a/numpy/core/include/numpy/old_defines.h b/numpy/core/include/numpy/old_defines.h
index abf81595a..b3fa67751 100644
--- a/numpy/core/include/numpy/old_defines.h
+++ b/numpy/core/include/numpy/old_defines.h
@@ -1,6 +1,6 @@
/* This header is deprecated as of NumPy 1.7 */
-#ifndef OLD_DEFINES_H
-#define OLD_DEFINES_H
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_OLD_DEFINES_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_OLD_DEFINES_H_
#if defined(NPY_NO_DEPRECATED_API) && NPY_NO_DEPRECATED_API >= NPY_1_7_API_VERSION
#error The header "old_defines.h" is deprecated as of NumPy 1.7.
@@ -184,4 +184,4 @@
#define PyArray_UCS4 npy_ucs4
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_OLD_DEFINES_H_ */
diff --git a/numpy/core/include/numpy/oldnumeric.h b/numpy/core/include/numpy/oldnumeric.h
index 38530faf0..6604e8d17 100644
--- a/numpy/core/include/numpy/oldnumeric.h
+++ b/numpy/core/include/numpy/oldnumeric.h
@@ -1,3 +1,8 @@
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_OLDNUMERIC_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_OLDNUMERIC_H_
+
+/* FIXME -- this file can be deleted? */
+
#include "arrayobject.h"
#ifndef PYPY_VERSION
@@ -23,3 +28,5 @@
#undef import_array
#define import_array() { if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); } }
+
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_OLDNUMERIC_H_ */
diff --git a/numpy/core/include/numpy/random/bitgen.h b/numpy/core/include/numpy/random/bitgen.h
index 83c2858dd..162dd5c57 100644
--- a/numpy/core/include/numpy/random/bitgen.h
+++ b/numpy/core/include/numpy/random/bitgen.h
@@ -1,5 +1,5 @@
-#ifndef _RANDOM_BITGEN_H
-#define _RANDOM_BITGEN_H
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_RANDOM_BITGEN_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_RANDOM_BITGEN_H_
#pragma once
#include <stddef.h>
@@ -17,4 +17,4 @@ typedef struct bitgen {
} bitgen_t;
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_RANDOM_BITGEN_H_ */
diff --git a/numpy/core/include/numpy/random/distributions.h b/numpy/core/include/numpy/random/distributions.h
index 434e052f5..dacf77829 100644
--- a/numpy/core/include/numpy/random/distributions.h
+++ b/numpy/core/include/numpy/random/distributions.h
@@ -1,5 +1,5 @@
-#ifndef _RANDOMDGEN__DISTRIBUTIONS_H_
-#define _RANDOMDGEN__DISTRIBUTIONS_H_
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_RANDOM_DISTRIBUTIONS_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_RANDOM_DISTRIBUTIONS_H_
#ifdef __cplusplus
extern "C" {
@@ -206,4 +206,4 @@ static NPY_INLINE double next_double(bitgen_t *bitgen_state) {
}
#endif
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_RANDOM_DISTRIBUTIONS_H_ */
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index fd7307703..3f184bd45 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -1,5 +1,5 @@
-#ifndef Py_UFUNCOBJECT_H
-#define Py_UFUNCOBJECT_H
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_UFUNCOBJECT_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_UFUNCOBJECT_H_
#include <numpy/npy_math.h>
#include <numpy/npy_common.h>
@@ -349,8 +349,8 @@ typedef struct _loop1d_info {
#endif
#endif
-
#ifdef __cplusplus
}
#endif
-#endif /* !Py_UFUNCOBJECT_H */
+
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_UFUNCOBJECT_H_ */
diff --git a/numpy/core/include/numpy/utils.h b/numpy/core/include/numpy/utils.h
index e251a5201..e2b57f9e5 100644
--- a/numpy/core/include/numpy/utils.h
+++ b/numpy/core/include/numpy/utils.h
@@ -1,5 +1,5 @@
-#ifndef __NUMPY_UTILS_HEADER__
-#define __NUMPY_UTILS_HEADER__
+#ifndef NUMPY_CORE_INCLUDE_NUMPY_UTILS_H_
+#define NUMPY_CORE_INCLUDE_NUMPY_UTILS_H_
#ifndef __COMP_NPY_UNUSED
#if defined(__GNUC__)
@@ -34,4 +34,4 @@
#define NPY_CAT_(a, b) NPY_CAT__(a, b)
#define NPY_CAT(a, b) NPY_CAT_(a, b)
-#endif
+#endif /* NUMPY_CORE_INCLUDE_NUMPY_UTILS_H_ */