From 0b4941337821a4a9e7719f8bd93bf24d3346ef1d Mon Sep 17 00:00:00 2001 From: Itamar Oren Date: Tue, 23 Apr 2024 19:07:44 -0700 Subject: [PATCH] undef the COMMON_FIELDS macro in funcobject.h after it is used 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 --- Include/cpython/funcobject.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Include/cpython/funcobject.h b/Include/cpython/funcobject.h index 6f78f5868d0..c1a72c1e2a6 100644 --- a/Include/cpython/funcobject.h +++ b/Include/cpython/funcobject.h @@ -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)