Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1171ee6

Browse files
committed
Added configuration tests for presence of alarm(), pause(), and getpwent()
1 parent 5de31fc commit 1171ee6

5 files changed

Lines changed: 24 additions & 11 deletions

File tree

Modules/pwdmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ pwd_getpwnam(self, args)
9090
return mkpwent(p);
9191
}
9292

93+
#ifdef HAVE_GETPWENT
9394
static PyObject *
9495
pwd_getpwall(self, args)
9596
PyObject *self;
@@ -113,11 +114,14 @@ pwd_getpwall(self, args)
113114
}
114115
return d;
115116
}
117+
#endif
116118

117119
static PyMethodDef pwd_methods[] = {
118120
{"getpwuid", pwd_getpwuid},
119121
{"getpwnam", pwd_getpwnam},
122+
#ifdef HAVE_GETPWENT
120123
{"getpwall", pwd_getpwall},
124+
#endif
121125
{NULL, NULL} /* sentinel */
122126
};
123127

Modules/signalmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ signal_handler(sig_num)
147147

148148

149149

150-
#ifndef DONT_HAVE_SIG_ALARM
150+
#ifdef HAVE_ALARM
151151
static PyObject *
152152
signal_alarm(self, args)
153153
PyObject *self; /* Not used */
@@ -161,7 +161,7 @@ signal_alarm(self, args)
161161
}
162162
#endif
163163

164-
#ifndef DONT_HAVE_SIG_PAUSE
164+
#ifdef HAVE_PAUSE
165165
static PyObject *
166166
signal_pause(self, args)
167167
PyObject *self; /* Not used */
@@ -254,12 +254,12 @@ signal_get_signal(self, args)
254254

255255
/* List of functions defined in the module */
256256
static PyMethodDef signal_methods[] = {
257-
#ifndef DONT_HAVE_SIG_ALARM
257+
#ifdef HAVE_ALARM
258258
{"alarm", signal_alarm},
259259
#endif
260260
{"signal", signal_signal},
261261
{"getsignal", signal_get_signal},
262-
#ifndef DONT_HAVE_SIG_PAUSE
262+
#ifdef HAVE_PAUSE
263263
{"pause", signal_pause},
264264
#endif
265265
{"default_int_handler", signal_default_int_handler},

config.h.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@
151151
/* The number of bytes in a long. */
152152
#undef SIZEOF_LONG
153153

154+
/* Define if you have the alarm function. */
155+
#undef HAVE_ALARM
156+
154157
/* Define if you have the chown function. */
155158
#undef HAVE_CHOWN
156159

@@ -193,6 +196,9 @@
193196
/* Define if you have the getpid function. */
194197
#undef HAVE_GETPID
195198

199+
/* Define if you have the getpwent function. */
200+
#undef HAVE_GETPWENT
201+
196202
/* Define if you have the gettimeofday function. */
197203
#undef HAVE_GETTIMEOFDAY
198204

@@ -220,6 +226,9 @@
220226
/* Define if you have the nice function. */
221227
#undef HAVE_NICE
222228

229+
/* Define if you have the pause function. */
230+
#undef HAVE_PAUSE
231+
223232
/* Define if you have the plock function. */
224233
#undef HAVE_PLOCK
225234

configure

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22

3-
# From configure.in Revision: 1.61
3+
# From configure.in Revision: 1.63
44

55
# Guess values for system-dependent variables and create Makefiles.
66
# Generated automatically using autoconf version 2.12
@@ -2480,9 +2480,9 @@ fi
24802480

24812481

24822482
# checks for library functions
2483-
for ac_func in chown clock dlopen execv flock fork ftime ftruncate \
2484-
gethostname_r getpeername getpgrp getpid gettimeofday getwd \
2485-
kill link lstat mkfifo nice plock putenv readlink \
2483+
for ac_func in alarm chown clock dlopen execv flock fork ftime ftruncate \
2484+
gethostname_r getpeername getpgrp getpid getpwent gettimeofday getwd \
2485+
kill link lstat mkfifo nice pause plock putenv readlink \
24862486
select setgid setuid setsid setpgid setpgrp setvbuf \
24872487
sigaction siginterrupt sigrelse strftime symlink \
24882488
tcgetpgrp tcsetpgrp times truncate uname waitpid

configure.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ DLINCLDIR=${dldir}
379379
LIBS="$LIBS -ldl -ldld"], AC_MSG_RESULT(no))
380380

381381
# checks for library functions
382-
AC_CHECK_FUNCS(chown clock dlopen execv flock fork ftime ftruncate \
383-
gethostname_r getpeername getpgrp getpid gettimeofday getwd \
384-
kill link lstat mkfifo nice plock putenv readlink \
382+
AC_CHECK_FUNCS(alarm chown clock dlopen execv flock fork ftime ftruncate \
383+
gethostname_r getpeername getpgrp getpid getpwent gettimeofday getwd \
384+
kill link lstat mkfifo nice pause plock putenv readlink \
385385
select setgid setuid setsid setpgid setpgrp setvbuf \
386386
sigaction siginterrupt sigrelse strftime symlink \
387387
tcgetpgrp tcsetpgrp times truncate uname waitpid)

0 commit comments

Comments
 (0)