Skip to content

Commit

Permalink
undef the COMMON_FIELDS macro in funcobject.h after it is used
Browse files Browse the repository at this point in the history
Summary:
based on D47485335

avoid the macro leaking to C++ code that happens to use the name `COMMON_FIELDS`

Reviewed By: zsol

Differential Revision: D56454529

fbshipit-source-id: 5b7192abf84748fb65548db3f350d375652fd5a7
  • Loading branch information
itamaro authored and facebook-github-bot committed Apr 24, 2024
1 parent a4b51a0 commit 0b49413
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Include/cpython/funcobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ typedef struct {
*/
} PyFunctionObject;

// START META PATCH (undef COMMON_FIELDS to avoid leaking into C++ code)
#undef COMMON_FIELDS
// END META PATCH

PyAPI_DATA(PyTypeObject) PyFunction_Type;

#define PyFunction_Check(op) Py_IS_TYPE((op), &PyFunction_Type)
Expand Down

0 comments on commit 0b49413

Please sign in to comment.