]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h (GH-18413)
authorSkip Montanaro <skip.montanaro@gmail.com>
Mon, 1 Jun 2020 18:35:56 +0000 (13:35 -0500)
committerGitHub <noreply@github.com>
Mon, 1 Jun 2020 18:35:56 +0000 (20:35 +0200)
20 files changed:
Include/cpython/abstract.h
Include/cpython/ceval.h
Include/cpython/dictobject.h
Include/cpython/fileobject.h
Include/cpython/frameobject.h
Include/cpython/import.h
Include/cpython/initconfig.h
Include/cpython/interpreteridobject.h
Include/cpython/listobject.h
Include/cpython/object.h
Include/cpython/objimpl.h
Include/cpython/pyerrors.h
Include/cpython/pylifecycle.h
Include/cpython/pymem.h
Include/cpython/pystate.h
Include/cpython/sysmodule.h
Include/cpython/traceback.h
Include/cpython/tupleobject.h
Include/cpython/unicodeobject.h
Misc/NEWS.d/next/C API/2020-02-08-08-01-35.bpo-39583.qURKSl.rst [new file with mode: 0644]

index aa72f998b701cf5d8b288f25d2e57b43860387ad..b5b6e4819788c5dd26e03443f2227a0367c67cab 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* === Object Protocol ================================================== */
 
 #ifdef PY_SSIZE_T_CLEAN
@@ -380,8 +376,4 @@ PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
 PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *);
 
 /* Same as PyNumber_Index but can return an instance of a subclass of int. */
-PyAPI_FUNC(PyObject *) _PyNumber_Index(PyObject *o);
-
-#ifdef __cplusplus
-}
-#endif
+PyAPI_FUNC(PyObject *) _PyNumber_Index(PyObject *o);
\ No newline at end of file
index e1922a677bd38c0563cc491c4e2969fdd872f812..06338928f6738b6063119c88f75cdfd8bceddf8b 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
 PyAPI_DATA(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
 PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
@@ -32,7 +28,3 @@ PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc);
 
 PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
 PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);
-
-#ifdef __cplusplus
-}
-#endif
index e33a0d156fead2a90773025699fad9d0ab992558..ffe0e97fb35f35599303971eb07fe34052c9ea9f 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct _dictkeysobject PyDictKeysObject;
 
 /* The ma_values pointer is NULL for a combined table
@@ -86,7 +82,3 @@ typedef struct {
 
 PyAPI_FUNC(PyObject *) _PyDictView_New(PyObject *, PyTypeObject *);
 PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other);
-
-#ifdef __cplusplus
-}
-#endif
index 57eac13c064c2e8905bd8c1d57c93405b7c00842..4f2408c7e8760899036e4b4d484e6f3c3b648483 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
 
 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
@@ -26,7 +22,3 @@ typedef PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *);
 PyAPI_FUNC(PyObject *) PyFile_OpenCode(const char *utf8path);
 PyAPI_FUNC(PyObject *) PyFile_OpenCodeObject(PyObject *path);
 PyAPI_FUNC(int) PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData);
-
-#ifdef __cplusplus
-}
-#endif
index 36a51baae8784bae26ab18169dce77ed4780edf9..c76fbe0616cb25b66592da8bf4c7fa5b68667b53 100644 (file)
@@ -4,10 +4,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct {
     int b_type;                 /* what kind of block this is */
     int b_handler;              /* where to jump to find handler */
@@ -78,7 +74,3 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
 PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out);
 
 PyAPI_FUNC(PyFrameObject *) PyFrame_GetBack(PyFrameObject *frame);
-
-#ifdef __cplusplus
-}
-#endif
index c1b47121f1246422759d4d0ffdd76522afb46e0d..3b20a74c855dbf78ca39fdff1b02d8ceee8f8546 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 PyMODINIT_FUNC PyInit__imp(void);
 
 PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *);
@@ -44,7 +40,3 @@ struct _frozen {
    collection of frozen modules: */
 
 PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
-
-#ifdef __cplusplus
-}
-#endif
index df93a5539d48bdee7b313c828c33dd8ab992edeb..e9c2e6bec3861181f4959fadc214ec31bd80251a 100644 (file)
@@ -1,9 +1,6 @@
 #ifndef Py_PYCORECONFIG_H
 #define Py_PYCORECONFIG_H
 #ifndef Py_LIMITED_API
-#ifdef __cplusplus
-extern "C" {
-#endif
 
 /* --- PyStatus ----------------------------------------------- */
 
@@ -438,8 +435,5 @@ PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config,
     PyWideStringList *list,
     Py_ssize_t length, wchar_t **items);
 
-#ifdef __cplusplus
-}
-#endif
 #endif /* !Py_LIMITED_API */
 #endif /* !Py_PYCORECONFIG_H */
index 67ec5873542d84765918ff0f9e76d17d4014d401..5076584209b90b4f8309913b9ade0fd121f8d526 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Interpreter ID Object */
 
 PyAPI_DATA(PyTypeObject) _PyInterpreterID_Type;
@@ -13,7 +9,3 @@ PyAPI_DATA(PyTypeObject) _PyInterpreterID_Type;
 PyAPI_FUNC(PyObject *) _PyInterpreterID_New(int64_t);
 PyAPI_FUNC(PyObject *) _PyInterpreterState_GetIDObject(PyInterpreterState *);
 PyAPI_FUNC(PyInterpreterState *) _PyInterpreterID_LookUp(PyObject *);
-
-#ifdef __cplusplus
-}
-#endif
index 74fe3301a7ab719faedba246790415cb1305b164..b1af5f6764427f37dea64029e43879135902772c 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct {
     PyObject_VAR_HEAD
     /* Vector of pointers to list elements.  list[0] is ob_item[0], etc. */
@@ -37,7 +33,3 @@ PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
 #define PyList_SET_ITEM(op, i, v) (_PyList_CAST(op)->ob_item[i] = (v))
 #define PyList_GET_SIZE(op)    Py_SIZE(_PyList_CAST(op))
 #define _PyList_ITEMS(op)      (_PyList_CAST(op)->ob_item)
-
-#ifdef __cplusplus
-}
-#endif
index 444f832f5bd8d313250d2328d2fe7f8628e473d5..304cfbfc37dff0f92fbe46ca16b6a3ac64686681 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
 
 #ifdef Py_TRACE_REFS
@@ -548,7 +544,3 @@ PyAPI_FUNC(void) _PyTrash_end(struct _ts *tstate);
  * unconditionally */
 #define Py_TRASHCAN_SAFE_BEGIN(op) Py_TRASHCAN_BEGIN_CONDITION(op, 1)
 #define Py_TRASHCAN_SAFE_END(op) Py_TRASHCAN_END
-
-#ifdef __cplusplus
-}
-#endif
index b835936db701120c562d35bfd6b7bbacfa9009f6..ca4009bcdb4c15798c27c26abc4e0e87a7048052 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize )
 
 /* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a
@@ -139,7 +135,3 @@ PyAPI_FUNC(PyObject *) _PyObject_GC_Calloc(size_t size);
 #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0)
 
 PyAPI_FUNC(PyObject **) PyObject_GET_WEAKREFS_LISTPTR(PyObject *op);
-
-#ifdef __cplusplus
-}
-#endif
index dd3c2caa0cc043517bed788adeb0d8969bae02b2..3f347dc2e2d62be5666ebac1572ad02cfb385b23 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Error objects */
 
 /* PyException_HEAD defines the initial segment of every exception class. */
@@ -188,7 +184,3 @@ PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFormat(
     ...);
 
 #define Py_FatalError(message) _Py_FatalErrorFunc(__func__, message)
-
-#ifdef __cplusplus
-}
-#endif
index eb523b82e182d8c4018661ed8ea7c9e2e587efb8..f38ec5a4ae3990ae180e8560a75ea866ca15120a 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Only used by applications that embed the interpreter and need to
  * override the standard encoding determination mechanism
  */
@@ -66,7 +62,3 @@ PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn);
 PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category);
 
 PyAPI_FUNC(PyThreadState *) _Py_NewInterpreter(int isolated_subinterpreter);
-
-#ifdef __cplusplus
-}
-#endif
index 79f063b1217534b8f3fc0b494ec55f3736f33f81..61d719584584e881d11d883eb696a37b9bb6297b 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
 PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize);
 PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
@@ -102,7 +98,3 @@ PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain,
 
    The function does nothing if Python is not compiled is debug mode. */
 PyAPI_FUNC(void) PyMem_SetupDebugHooks(void);
-
-#ifdef __cplusplus
-}
-#endif
index f292da1d3c6c5ee48ceaad0639b9cb42d4414d9f..42a7fc163064dc8825f17cd1dfd9fdc68b4aca1a 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include "cpython/initconfig.h"
 
 PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *);
@@ -257,7 +253,3 @@ typedef int (*crossinterpdatafunc)(PyObject *, struct _xid *);
 
 PyAPI_FUNC(int) _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc);
 PyAPI_FUNC(crossinterpdatafunc) _PyCrossInterpreterData_Lookup(PyObject *);
-
-#ifdef __cplusplus
-}
-#endif
index 1802b5b300018e6498e0a4fdf469df0bb3a1285d..fc4c899b3fe3dc3a7c6d75aa5f38b19c42df9d21 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key);
 PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);
 
@@ -18,7 +14,3 @@ PyAPI_FUNC(int) PySys_Audit(
     const char *argFormat,
     ...);
 PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*);
-
-#ifdef __cplusplus
-}
-#endif
index 837470c3ba2bca9491901e7d8cf14557fde27130..aac5b42c344d3f6ebdb65d7837725218612d0576 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct _traceback {
     PyObject_HEAD
     struct _traceback *tb_next;
@@ -16,7 +12,3 @@ typedef struct _traceback {
 
 PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int);
 PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int);
-
-#ifdef __cplusplus
-}
-#endif
index 1565f2a5c3d986ac041208e57d32e8969e48a583..51dcd4237be18ce2542ae72784c7e9980d1e6bfa 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct {
     PyObject_VAR_HEAD
     /* ob_item contains space for 'ob_size' elements.
@@ -30,7 +26,3 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
 #define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v)
 
 PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out);
-
-#ifdef __cplusplus
-}
-#endif
index 4fd674ffea36eae25e6e5e1cc86e45cdc84c00fa..3b49ce7759037e18daf077bf9c6c741ad0461673 100644 (file)
@@ -2,10 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Py_UNICODE was the native Unicode storage format (code unit) used by
    Python and represents a single Unicode element in the Unicode type.
    With PEP 393, Py_UNICODE is deprecated and replaced with a
@@ -1221,7 +1217,3 @@ PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*);
 PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *);
 
 PyAPI_FUNC(Py_ssize_t) _PyUnicode_ScanIdentifier(PyObject *);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/Misc/NEWS.d/next/C API/2020-02-08-08-01-35.bpo-39583.qURKSl.rst b/Misc/NEWS.d/next/C API/2020-02-08-08-01-35.bpo-39583.qURKSl.rst
new file mode 100644 (file)
index 0000000..1c9f44f
--- /dev/null
@@ -0,0 +1 @@
+Remove superfluous "extern C" declarations from ``Include/cpython/*.h``.