mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Added configuration tests for presence of alarm(), pause(), and getpwent()
This commit is contained in:
parent
5de31fc094
commit
1171ee6aaf
5 changed files with 24 additions and 11 deletions
|
|
@ -90,6 +90,7 @@ pwd_getpwnam(self, args)
|
|||
return mkpwent(p);
|
||||
}
|
||||
|
||||
#ifdef HAVE_GETPWENT
|
||||
static PyObject *
|
||||
pwd_getpwall(self, args)
|
||||
PyObject *self;
|
||||
|
|
@ -113,11 +114,14 @@ pwd_getpwall(self, args)
|
|||
}
|
||||
return d;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyMethodDef pwd_methods[] = {
|
||||
{"getpwuid", pwd_getpwuid},
|
||||
{"getpwnam", pwd_getpwnam},
|
||||
#ifdef HAVE_GETPWENT
|
||||
{"getpwall", pwd_getpwall},
|
||||
#endif
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ signal_handler(sig_num)
|
|||
|
||||
|
||||
|
||||
#ifndef DONT_HAVE_SIG_ALARM
|
||||
#ifdef HAVE_ALARM
|
||||
static PyObject *
|
||||
signal_alarm(self, args)
|
||||
PyObject *self; /* Not used */
|
||||
|
|
@ -161,7 +161,7 @@ signal_alarm(self, args)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef DONT_HAVE_SIG_PAUSE
|
||||
#ifdef HAVE_PAUSE
|
||||
static PyObject *
|
||||
signal_pause(self, args)
|
||||
PyObject *self; /* Not used */
|
||||
|
|
@ -254,12 +254,12 @@ signal_get_signal(self, args)
|
|||
|
||||
/* List of functions defined in the module */
|
||||
static PyMethodDef signal_methods[] = {
|
||||
#ifndef DONT_HAVE_SIG_ALARM
|
||||
#ifdef HAVE_ALARM
|
||||
{"alarm", signal_alarm},
|
||||
#endif
|
||||
{"signal", signal_signal},
|
||||
{"getsignal", signal_get_signal},
|
||||
#ifndef DONT_HAVE_SIG_PAUSE
|
||||
#ifdef HAVE_PAUSE
|
||||
{"pause", signal_pause},
|
||||
#endif
|
||||
{"default_int_handler", signal_default_int_handler},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue