Skip to content

Commit e502451

Browse files
authored
closes bpo-34646: Remove PyAPI_* macros from declarations. (GH-9218)
1 parent 019f0a0 commit e502451

File tree

13 files changed

+33
-31
lines changed

13 files changed

+33
-31
lines changed

Modules/_hashopenssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ EVP_hexdigest(EVPobject *self, PyObject *unused)
245245

246246
EVP_MD_CTX_free(temp_ctx);
247247

248-
return _Py_strhex((const char *)digest, digest_size);
248+
return _Py_strhex((const char *)digest, (Py_ssize_t)digest_size);
249249
}
250250

251251
PyDoc_STRVAR(EVP_update__doc__,

Modules/_io/winconsoleio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,6 @@ PyTypeObject PyWindowsConsoleIO_Type = {
11701170
0, /* tp_finalize */
11711171
};
11721172

1173-
PyAPI_DATA(PyObject *) _PyWindowsConsoleIO_Type = (PyObject*)&PyWindowsConsoleIO_Type;
1173+
PyObject * _PyWindowsConsoleIO_Type = (PyObject*)&PyWindowsConsoleIO_Type;
11741174

11751175
#endif /* MS_WINDOWS */

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ PyOS_AfterFork(void)
488488

489489
#ifdef MS_WINDOWS
490490
/* defined in fileutils.c */
491-
PyAPI_FUNC(void) _Py_time_t_to_FILE_TIME(time_t, int, FILETIME *);
492-
PyAPI_FUNC(void) _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *,
491+
void _Py_time_t_to_FILE_TIME(time_t, int, FILETIME *);
492+
void _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *,
493493
ULONG, struct _Py_stat_struct *);
494494
#endif
495495

Objects/methodobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static int numfree = 0;
1818
/* undefine macro trampoline to PyCFunction_NewEx */
1919
#undef PyCFunction_New
2020

21-
PyAPI_FUNC(PyObject *)
21+
PyObject *
2222
PyCFunction_New(PyMethodDef *ml, PyObject *self)
2323
{
2424
return PyCFunction_NewEx(ml, self, NULL);

Objects/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2180,7 +2180,7 @@ _PyTrash_thread_destroy_chain(void)
21802180
/* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc.
21812181
Define this here, so we can undefine the macro. */
21822182
#undef _Py_Dealloc
2183-
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
2183+
void _Py_Dealloc(PyObject *);
21842184
void
21852185
_Py_Dealloc(PyObject *op)
21862186
{

Parser/printgrammar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ printgrammar(grammar *g, FILE *fp)
1818
fprintf(fp, "/* Generated by Parser/pgen */\n\n");
1919
fprintf(fp, "#include \"pgenheaders.h\"\n");
2020
fprintf(fp, "#include \"grammar.h\"\n");
21-
fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n");
21+
fprintf(fp, "grammar _PyParser_Grammar;\n");
2222
printdfas(g, fp);
2323
printlabels(g, fp);
2424
fprintf(fp, "grammar _PyParser_Grammar = {\n");

Python/_warnings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ PyErr_WarnEx(PyObject *category, const char *text, Py_ssize_t stack_level)
10041004

10051005
#undef PyErr_Warn
10061006

1007-
PyAPI_FUNC(int)
1007+
int
10081008
PyErr_Warn(PyObject *category, const char *text)
10091009
{
10101010
return PyErr_WarnEx(category, text, 1);

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5550,7 +5550,7 @@ assemble(struct compiler *c, int addNone)
55505550
}
55515551

55525552
#undef PyAST_Compile
5553-
PyAPI_FUNC(PyCodeObject *)
5553+
PyCodeObject *
55545554
PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
55555555
PyArena *arena)
55565556
{

Python/graminit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "pgenheaders.h"
44
#include "grammar.h"
5-
PyAPI_DATA(grammar) _PyParser_Grammar;
5+
grammar _PyParser_Grammar;
66
static arc arcs_0_0[3] = {
77
{2, 1},
88
{3, 1},

Python/import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ get_path_importer(PyObject *path_importer_cache, PyObject *path_hooks,
11381138
return importer;
11391139
}
11401140

1141-
PyAPI_FUNC(PyObject *)
1141+
PyObject *
11421142
PyImport_GetImporter(PyObject *path) {
11431143
PyObject *importer=NULL, *path_importer_cache=NULL, *path_hooks=NULL;
11441144

0 commit comments

Comments
 (0)