mirror of
https://github.com/python/cpython.git
synced 2025-09-03 23:41:18 +00:00
gh-110079: Remove extern "C" { ...} in C code (#110080)
This commit is contained in:
parent
bfd94ab9e9
commit
8b626a47ba
18 changed files with 6 additions and 168 deletions
|
@ -172,10 +172,6 @@ typedef uint64_t ULLong;
|
|||
#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef union { double d; ULong L[2]; } U;
|
||||
|
||||
#ifdef IEEE_8087
|
||||
|
@ -2813,8 +2809,5 @@ _Py_dg_dtoa(double dd, int mode, int ndigits,
|
|||
_Py_dg_freedtoa(s0);
|
||||
return NULL;
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _PY_SHORT_FLOAT_REPR == 1
|
||||
|
|
|
@ -16,11 +16,6 @@
|
|||
# include <stdlib.h> // _sys_nerr
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
static PyObject *
|
||||
_PyErr_FormatV(PyThreadState *tstate, PyObject *exception,
|
||||
|
@ -1918,7 +1913,3 @@ PyErr_ProgramTextObject(PyObject *filename, int lineno)
|
|||
{
|
||||
return _PyErr_ProgramDecodedTextObject(filename, lineno, NULL);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -7,10 +7,6 @@
|
|||
#include "pycore_pylifecycle.h" // _PyArg_Fini
|
||||
#include "pycore_tuple.h" // _PyTuple_ITEMS()
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Export Stable ABIs (abi only) */
|
||||
PyAPI_FUNC(int) _PyArg_Parse_SizeT(PyObject *, const char *, ...);
|
||||
PyAPI_FUNC(int) _PyArg_ParseTuple_SizeT(PyObject *, const char *, ...);
|
||||
|
@ -2867,7 +2863,3 @@ _PyArg_Fini(void)
|
|||
}
|
||||
_PyRuntime.getargs.static_parsers = NULL;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -29,10 +29,6 @@
|
|||
#include <wchar.h>
|
||||
#include "pycore_getopt.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int _PyOS_opterr = 1; /* generate error messages */
|
||||
Py_ssize_t _PyOS_optind = 1; /* index into argv array */
|
||||
const wchar_t *_PyOS_optarg = NULL; /* optional argument */
|
||||
|
@ -172,8 +168,3 @@ int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex)
|
|||
|
||||
return option;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*[clinic input]
|
||||
|
@ -3887,8 +3884,3 @@ PyInit__imp(void)
|
|||
{
|
||||
return PyModuleDef_Init(&imp_module);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -16,10 +16,6 @@
|
|||
# include <shlwapi.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* External interface */
|
||||
|
||||
|
@ -500,8 +496,3 @@ _PyPathConfig_ComputeSysPath0(const PyWideStringList *argv, PyObject **path0_p)
|
|||
*path0_p = path0_obj;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -14,10 +14,6 @@
|
|||
# include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
_Py_HashSecret_t _Py_HashSecret = {{0}};
|
||||
|
||||
#if Py_HASH_ALGORITHM == Py_HASH_EXTERNAL
|
||||
|
@ -503,7 +499,3 @@ pysiphash(const void *src, Py_ssize_t src_sz) {
|
|||
|
||||
static PyHash_FuncDef PyHash_Func = {pysiphash, "siphash24", 64, 128};
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -61,11 +61,6 @@
|
|||
#define PUTS(fd, str) (void)_Py_write_noraise(fd, str, (int)strlen(str))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static PyStatus add_main_module(PyInterpreterState *interp);
|
||||
static PyStatus init_import_site(void);
|
||||
|
@ -3139,7 +3134,3 @@ PyOS_setsig(int sig, PyOS_sighandler_t handler)
|
|||
return oldhandler;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -29,16 +29,12 @@ to avoid the expense of doing their own locking).
|
|||
-------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
#ifdef HAVE_DLFCN_H
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
#if !HAVE_DECL_RTLD_LAZY
|
||||
#define RTLD_LAZY 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
# ifdef HAVE_DLFCN_H
|
||||
# include <dlfcn.h>
|
||||
# endif
|
||||
# if !HAVE_DECL_RTLD_LAZY
|
||||
# define RTLD_LAZY 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -2985,8 +2981,3 @@ _PyThreadState_MustExit(PyThreadState *tstate)
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -37,11 +37,6 @@
|
|||
# include "windows.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward */
|
||||
static void flush_io(void);
|
||||
static PyObject *run_mod(mod_ty, PyObject *, PyObject *, PyObject *,
|
||||
|
@ -2017,7 +2012,3 @@ PyRun_InteractiveLoop(FILE *f, const char *p)
|
|||
{
|
||||
return PyRun_InteractiveLoopFlags(f, p, NULL);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2039,11 +2039,6 @@ sys_call_tracing_impl(PyObject *module, PyObject *func, PyObject *funcargs)
|
|||
return _PyEval_CallTracing(func, funcargs);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*[clinic input]
|
||||
sys._debugmallocstats
|
||||
|
||||
|
@ -2072,10 +2067,6 @@ sys__debugmallocstats_impl(PyObject *module)
|
|||
extern PyObject *_Py_GetObjects(PyObject *, PyObject *);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*[clinic input]
|
||||
sys._clear_type_cache
|
||||
|
@ -2297,11 +2288,6 @@ sys__getframemodulename_impl(PyObject *module, int depth)
|
|||
return Py_NewRef(r);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static PerfMapState perf_map_state;
|
||||
|
||||
PyAPI_FUNC(int) PyUnstable_PerfMapState_Init(void) {
|
||||
|
@ -2370,10 +2356,6 @@ PyAPI_FUNC(void) PyUnstable_PerfMapState_Fini(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static PyMethodDef sys_methods[] = {
|
||||
/* Might as well keep this in alphabetic order */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue