Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Standardize guards in numpy/core/include #19826

Merged
merged 1 commit into from
Sep 8, 2021

Conversation

charris
Copy link
Member

@charris charris commented Sep 4, 2021

This standardizes the header guards in numpy/core/include/numpy.
The standard here is <path>_<name>_H_ For instance:

file: numpy/core/include/numpy/arrayobject.h
guard: NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_

Macro names can be up to 255 characters, so length is not a problem.

This convention comes from the Google code style and keeps files with
the same name but different locations from stepping on each other.

@@ -9,11 +9,12 @@
#ifndef NPY_NO_DEPRECATED_API
Copy link
Member Author

@charris charris Sep 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is not a guard, it defines NPY_NO_DEPRECATED_API for use in Cython *.pyd files.

@charris charris changed the title MAINT: Standardize header guards, MAINT: Standardize header guards in numpy/core/include Sep 4, 2021
@charris charris changed the title MAINT: Standardize header guards in numpy/core/include MAINT: Standardize guards in numpy/core/include Sep 5, 2021
This standardizes the header guards in numpy/core/include/numpy.
The standard here is `<path>_<name>_H_` For instance, the file

file: numpy/core/include/numpy/arrayobject.h
guard: NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_

Macro names can be up to 255 characters, so length is not a problem.

This convention comes from the Google code style and keeps files with
the same name but different locations from stepping on each other.
@charris charris merged commit 5d04798 into numpy:main Sep 8, 2021
@charris charris deleted the cleanup-header-guards branch September 8, 2021 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant