Skip to content

Commit

Permalink
Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
Browse files Browse the repository at this point in the history
for Py_Main().

Thanks to Kalle Svensson and Skip Montanaro for the patches.
  • Loading branch information
mhammond committed Aug 2, 2002
1 parent d3c884d commit fe51c6d
Show file tree
Hide file tree
Showing 53 changed files with 71 additions and 61 deletions.
3 changes: 3 additions & 0 deletions Include/pythonrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ DL_IMPORT(void) Py_Exit(int);

DL_IMPORT(int) Py_FdIsInteractive(FILE *, char *);

/* Bootstrap */
PyAPI_FUNC(int) Py_Main(int argc, char **argv);

/* In getpath.c */
PyAPI_FUNC(char *) Py_GetProgramFullPath(void);
PyAPI_FUNC(char *) Py_GetPrefix(void);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_codecsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ static PyMethodDef _codecs_functions[] = {
{NULL, NULL} /* sentinel */
};

DL_EXPORT(void)
PyMODINIT_FUNC
init_codecs(void)
{
Py_InitModule("_codecs", _codecs_functions);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_curses_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ static PyMethodDef PyCurses_methods[] = {

/* Initialization function for the module */

DL_EXPORT(void)
PyMODINIT_FUNC
init_curses_panel(void)
{
PyObject *m, *d, *v;
Expand Down
2 changes: 1 addition & 1 deletion Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,7 @@ static PyMethodDef PyCurses_methods[] = {

/* Initialization function for the module */

DL_EXPORT(void)
PyMODINIT_FUNC
init_curses(void)
{
PyObject *m, *d, *v, *c_api_object;
Expand Down
2 changes: 1 addition & 1 deletion Modules/_localemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ static struct PyMethodDef PyLocale_Methods[] = {
{NULL, NULL}
};

DL_EXPORT(void)
PyMODINIT_FUNC
init_locale(void)
{
PyObject *m, *d, *x;
Expand Down
2 changes: 1 addition & 1 deletion Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ PyDoc_STRVAR(module_doc,
"Implementation module for SSL socket operations. See the socket module\n\
for documentation.");

DL_EXPORT(void)
PyMODINIT_FUNC
init_ssl(void)
{
PyObject *m, *d;
Expand Down
2 changes: 1 addition & 1 deletion Modules/_weakref.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ weakref_functions[] = {
};


DL_EXPORT(void)
PyMODINIT_FUNC
init_weakref(void)
{
PyObject *m;
Expand Down
2 changes: 1 addition & 1 deletion Modules/arraymodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ static PyMethodDef a_methods[] = {
};


DL_EXPORT(void)
PyMODINIT_FUNC
initarray(void)
{
PyObject *m;
Expand Down
2 changes: 1 addition & 1 deletion Modules/audioop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ static PyMethodDef audioop_methods[] = {
{ 0, 0 }
};

DL_EXPORT(void)
PyMODINIT_FUNC
initaudioop(void)
{
PyObject *m, *d;
Expand Down
2 changes: 1 addition & 1 deletion Modules/binascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ static struct PyMethodDef binascii_module_methods[] = {
/* Initialization function for the module (*must* be called initbinascii) */
PyDoc_STRVAR(doc_binascii, "Conversion between binary data and ASCII");

DL_EXPORT(void)
PyMODINIT_FUNC
initbinascii(void)
{
PyObject *m, *d, *x;
Expand Down
6 changes: 3 additions & 3 deletions Modules/cPickle.c
Original file line number Diff line number Diff line change
Expand Up @@ -4789,10 +4789,10 @@ init_stuff(PyObject *module_dict)
return 0;
}

#ifndef DL_EXPORT /* declarations for DLL import/export */
#define DL_EXPORT(RTYPE) RTYPE
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
DL_EXPORT(void)
PyMODINIT_FUNC
initcPickle(void)
{
PyObject *m, *d, *di, *v, *k;
Expand Down
6 changes: 3 additions & 3 deletions Modules/cStringIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,10 @@ static struct PycStringIO_CAPI CAPI = {
&Otype,
};

#ifndef DL_EXPORT /* declarations for DLL import/export */
#define DL_EXPORT(RTYPE) RTYPE
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
DL_EXPORT(void)
PyMODINIT_FUNC
initcStringIO(void) {
PyObject *m, *d, *v;

Expand Down
2 changes: 1 addition & 1 deletion Modules/cmathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static PyMethodDef cmath_methods[] = {
{NULL, NULL} /* sentinel */
};

DL_EXPORT(void)
PyMODINIT_FUNC
initcmath(void)
{
PyObject *m;
Expand Down
2 changes: 1 addition & 1 deletion Modules/cryptmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static PyMethodDef crypt_methods[] = {
{NULL, NULL} /* sentinel */
};

DL_EXPORT(void)
PyMODINIT_FUNC
initcrypt(void)
{
Py_InitModule("crypt", crypt_methods);
Expand Down
2 changes: 1 addition & 1 deletion Modules/dbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static PyMethodDef dbmmodule_methods[] = {
{ 0, 0 },
};

DL_EXPORT(void)
PyMODINIT_FUNC
initdbm(void) {
PyObject *m, *d, *s;

Expand Down
2 changes: 1 addition & 1 deletion Modules/dlmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ insint(PyObject *d, char *name, int value)
Py_XDECREF(v);
}

DL_EXPORT(void)
PyMODINIT_FUNC
initdl(void)
{
PyObject *m, *d, *x;
Expand Down
2 changes: 1 addition & 1 deletion Modules/errnomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Symbols that are not relevant to the underlying system are not defined.\n\
To map error codes to error messages, use the function os.strerror(),\n\
e.g. os.strerror(2) could return 'No such file or directory'.");

DL_EXPORT(void)
PyMODINIT_FUNC
initerrno(void)
{
PyObject *m, *d, *de;
Expand Down
2 changes: 1 addition & 1 deletion Modules/fcntlmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ all_ins(PyObject* d)
return 0;
}

DL_EXPORT(void)
PyMODINIT_FUNC
initfcntl(void)
{
PyObject *m, *d;
Expand Down
2 changes: 1 addition & 1 deletion Modules/flmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,7 @@ static PyMethodDef forms_methods[] = {
{NULL, NULL} /* sentinel */
};

DL_EXPORT(void)
PyMODINIT_FUNC
initfl(void)
{
Py_InitModule("fl", forms_methods);
Expand Down
4 changes: 2 additions & 2 deletions Modules/fpectlmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static Sigfunc sigfpe_handler;
static void fpe_reset(Sigfunc *);

static PyObject *fpe_error;
DL_EXPORT(void) initfpectl(void);
PyMODINIT_FUNC initfpectl(void);
static PyObject *turnon_sigfpe (PyObject *self,PyObject *args);
static PyObject *turnoff_sigfpe (PyObject *self,PyObject *args);

Expand Down Expand Up @@ -249,7 +249,7 @@ static void sigfpe_handler(int signo)
}
}

DL_EXPORT(void) initfpectl(void)
PyMODINIT_FUNC initfpectl(void)
{
PyObject *m, *d;
m = Py_InitModule("fpectl", fpectl_methods);
Expand Down
4 changes: 2 additions & 2 deletions Modules/fpetestmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "Python.h"

static PyObject *fpe_error;
DL_EXPORT(void) initfpetest(void);
PyMODINIT_FUNC initfpetest(void);
static PyObject *test(PyObject *self,PyObject *args);
static double db0(double);
static double overflow(double);
Expand Down Expand Up @@ -172,7 +172,7 @@ static double overflow(double b)
return a;
}

DL_EXPORT(void) initfpetest(void)
PyMODINIT_FUNC initfpetest(void)
{
PyObject *m, *d;

Expand Down
2 changes: 1 addition & 1 deletion Modules/gdbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ static PyMethodDef dbmmodule_methods[] = {
{ 0, 0 },
};

DL_EXPORT(void)
PyMODINIT_FUNC
initgdbm(void) {
PyObject *m, *d, *s;

Expand Down
2 changes: 1 addition & 1 deletion Modules/grpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ according to the password database. Check both databases to get\n\
complete membership information.)");


DL_EXPORT(void)
PyMODINIT_FUNC
initgrp(void)
{
PyObject *m, *d;
Expand Down
2 changes: 1 addition & 1 deletion Modules/imageop.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static PyMethodDef imageop_methods[] = {
};


DL_EXPORT(void)
PyMODINIT_FUNC
initimageop(void)
{
PyObject *m, *d;
Expand Down
2 changes: 1 addition & 1 deletion Modules/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ usage(int exitcode, char* program)

/* Main program */

DL_EXPORT(int)
int
Py_Main(int argc, char **argv)
{
int c;
Expand Down
2 changes: 1 addition & 1 deletion Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ PyDoc_STRVAR(module_doc,
"This module is always available. It provides access to the\n"
"mathematical functions defined by the C standard.");

DL_EXPORT(void)
PyMODINIT_FUNC
initmath(void)
{
PyObject *m, *d, *v;
Expand Down
2 changes: 1 addition & 1 deletion Modules/md5module.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static PyMethodDef md5_functions[] = {

/* Initialize this module. */

DL_EXPORT(void)
PyMODINIT_FUNC
initmd5(void)
{
PyObject *m, *d;
Expand Down
2 changes: 1 addition & 1 deletion Modules/mpzmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ void mp_free(void *ptr, size_t size)

/* Initialize this module. */

DL_EXPORT(void)
PyMODINIT_FUNC
initmpz(void)
{
PyObject *module;
Expand Down
2 changes: 1 addition & 1 deletion Modules/operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ spam2(ge,__ge__, "ge(a, b) -- Same as a>=b.")

/* Initialization function for the module (*must* be called initoperator) */

DL_EXPORT(void)
PyMODINIT_FUNC
initoperator(void)
{
/* Create the module and add the functions */
Expand Down
2 changes: 1 addition & 1 deletion Modules/pcremodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ insint(PyObject *d, char *name, int value)

/* Initialization function for the module (*must* be called initpcre) */

DL_EXPORT(void)
PyMODINIT_FUNC
initpcre(void)
{
PyObject *m, *d;
Expand Down
15 changes: 13 additions & 2 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3211,6 +3211,7 @@ _PyPopenCreateProcess(char *cmdstring,
{
PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo;
DWORD dwProcessFlags = 0; /* no NEW_CONSOLE by default for Ctrl+C handling */
char *s1,*s2, *s3 = " /c ";
const char *szConsoleSpawn = "w9xpopen.exe";
int i;
Expand Down Expand Up @@ -3303,6 +3304,16 @@ _PyPopenCreateProcess(char *cmdstring,
s1,
s3,
cmdstring);
/* Not passing CREATE_NEW_CONSOLE has been known to
cause random failures on win9x. Specifically a
dialog:
"Your program accessed mem currently in use at xxx"
and a hopeful warning about the stability of your
system.
Cost is Ctrl+C wont kill children, but anyone
who cares can have a go!
*/
dwProcessFlags |= CREATE_NEW_CONSOLE;
}
}

Expand All @@ -3328,7 +3339,7 @@ _PyPopenCreateProcess(char *cmdstring,
NULL,
NULL,
TRUE,
0, /* no new console so Ctrl+C kills child too */
dwProcessFlags,
NULL,
NULL,
&siStartInfo,
Expand Down Expand Up @@ -6746,7 +6757,7 @@ all_ins(PyObject *d)
#define MODNAME "posix"
#endif

DL_EXPORT(void)
PyMODINIT_FUNC
INITFUNC(void)
{
PyObject *m, *v;
Expand Down
2 changes: 1 addition & 1 deletion Modules/pwdmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static PyMethodDef pwd_methods[] = {
{NULL, NULL} /* sentinel */
};

DL_EXPORT(void)
PyMODINIT_FUNC
initpwd(void)
{
PyObject *m;
Expand Down
2 changes: 0 additions & 2 deletions Modules/python.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#include "Python.h"

extern DL_EXPORT(int) Py_Main(int, char **);

int
main(int argc, char **argv)
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ call_readline(char *prompt)
PyDoc_STRVAR(doc_module,
"Importing this module enables command line editing using GNU readline.");

DL_EXPORT(void)
PyMODINIT_FUNC
initreadline(void)
{
PyObject *m;
Expand Down
2 changes: 1 addition & 1 deletion Modules/regexmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ static struct PyMethodDef regex_global_methods[] = {
{NULL, NULL} /* sentinel */
};

DL_EXPORT(void)
PyMODINIT_FUNC
initregex(void)
{
PyObject *m, *d, *v;
Expand Down
2 changes: 1 addition & 1 deletion Modules/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ resource_methods[] = {

/* Module initialization */

DL_EXPORT(void)
PyMODINIT_FUNC
initresource(void)
{
PyObject *m, *v;
Expand Down
2 changes: 1 addition & 1 deletion Modules/rgbimgmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ rgbimg_methods[] = {
};


DL_EXPORT(void)
PyMODINIT_FUNC
initrgbimg(void)
{
PyObject *m, *d;
Expand Down
Loading

0 comments on commit fe51c6d

Please sign in to comment.