Skip to content

gh-135755: Use private names (_Py*) for header file guards new in 3.14 #135921

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

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Include/audit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef Py_AUDIT_H
#define Py_AUDIT_H
#ifndef _Py_AUDIT_H
#define _Py_AUDIT_H
#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -18,13 +18,13 @@ PyAPI_FUNC(int) PySys_AuditTuple(


#ifndef Py_LIMITED_API
# define Py_CPYTHON_AUDIT_H
# define _Py_CPYTHON_AUDIT_H
# include "cpython/audit.h"
# undef Py_CPYTHON_AUDIT_H
# undef _Py_CPYTHON_AUDIT_H
#endif


#ifdef __cplusplus
}
#endif
#endif /* !Py_AUDIT_H */
#endif /* !_Py_AUDIT_H */
2 changes: 1 addition & 1 deletion Include/cpython/audit.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef Py_CPYTHON_AUDIT_H
#ifndef _Py_CPYTHON_AUDIT_H
# error "this header file must not be included directly"
#endif

Expand Down
6 changes: 3 additions & 3 deletions Include/refcount.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef Py_REFCOUNT_H
#define Py_REFCOUNT_H
#ifndef _Py_REFCOUNT_H
#define _Py_REFCOUNT_H
#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -561,4 +561,4 @@ static inline PyObject* _Py_XNewRef(PyObject *obj)
#ifdef __cplusplus
}
#endif
#endif // !Py_REFCOUNT_H
#endif // !_Py_REFCOUNT_H
Loading