From 468e639cbd8260d9472d2b91271825068d557ddf Mon Sep 17 00:00:00 2001 From: "Andrew V. Jones" Date: Mon, 12 Apr 2021 16:17:12 +0100 Subject: [PATCH 1/2] bpo-43816: add 'extern "C"' to pyctype.h Signed-off-by: Andrew V. Jones --- Include/cpython/pyctype.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Include/cpython/pyctype.h b/Include/cpython/pyctype.h index 6bce63eeb63b82..3ec2175a4039b7 100644 --- a/Include/cpython/pyctype.h +++ b/Include/cpython/pyctype.h @@ -2,6 +2,10 @@ #ifndef PYCTYPE_H #define PYCTYPE_H +#ifdef __cplusplus +extern "C" { +#endif + #define PY_CTF_LOWER 0x01 #define PY_CTF_UPPER 0x02 #define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER) @@ -29,5 +33,9 @@ PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256]; #define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) #define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) +#ifdef __cplusplus +} +#endif + #endif /* !PYCTYPE_H */ #endif /* !Py_LIMITED_API */ From 6976d57ad723725867447c7baa18823619d32212 Mon Sep 17 00:00:00 2001 From: "Andrew V. Jones" Date: Tue, 13 Apr 2021 08:26:19 +0100 Subject: [PATCH 2/2] bpo-43816: ensuring whitespace consistency around #ifdef __cplusplus Signed-off-by: Andrew V. Jones --- Include/cpython/pyctype.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Include/cpython/pyctype.h b/Include/cpython/pyctype.h index 3ec2175a4039b7..729d93275e6c53 100644 --- a/Include/cpython/pyctype.h +++ b/Include/cpython/pyctype.h @@ -1,7 +1,6 @@ #ifndef Py_LIMITED_API #ifndef PYCTYPE_H #define PYCTYPE_H - #ifdef __cplusplus extern "C" { #endif @@ -36,6 +35,5 @@ PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256]; #ifdef __cplusplus } #endif - #endif /* !PYCTYPE_H */ #endif /* !Py_LIMITED_API */