Index: configure.in =================================================================== --- configure.in (revision 67033) +++ configure.in (working copy) @@ -276,12 +276,19 @@ # but used in struct sockaddr.sa_family. Reported by Tim Rice. SCO_SV/3.2) define_xopen_source=no;; - # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that - # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently, - # this is fixed in 10.3, which identifies itself as Darwin/7.* - # This should hopefully be fixed in FreeBSD 4.9 - FreeBSD/4.8* | Darwin/6* ) + # On FreeBSD 4, the math functions C89 does not cover are never defined + # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them. + FreeBSD/4.*) define_xopen_source=no;; + # On MacOS X 10.2, a bug in ncurses.h means that it craps out if + # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which + # identifies itself as Darwin/7.* + # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE + # disables platform specific features beyond repair. + # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE + # has no effect, don't bother defining them + Darwin/@<:@6789@:>@.*) + define_xopen_source=no;; # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined # or has another value. By not (re)defining it, the defaults come in place. @@ -292,13 +299,6 @@ define_xopen_source=no fi ;; - # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE - # disables platform specific features beyond repair. - # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE - # has no effect, don't bother defining them - Darwin/@<:@789@:>@.*) - define_xopen_source=no - ;; # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from # defining NI_NUMERICHOST. QNX/6.3.2) Index: setup.py =================================================================== --- setup.py (revision 67033) +++ setup.py (working copy) @@ -1261,7 +1261,7 @@ ) libraries = [] - elif platform in ('freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'): + elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'): # FreeBSD's P1003.1b semaphore support is very experimental # and has many known problems. (as of June 2008) macros = dict( # FreeBSD Index: Misc/NEWS =================================================================== --- Misc/NEWS (revision 67033) +++ Misc/NEWS (working copy) @@ -50,6 +50,8 @@ - Issue #3758: Add ``patchcheck`` build target to .PHONY. +- Issue #4204: Fixed module build errors on FreeBSD 4. + C-API ----- Index: Modules/readline.c =================================================================== --- Modules/readline.c (revision 67033) +++ Modules/readline.c (working copy) @@ -35,8 +35,12 @@ #define completion_matches(x, y) \ rl_completion_matches((x), ((rl_compentry_func_t *)(y))) #else +#if defined(_RL_FUNCTION_TYPEDEF) extern char **completion_matches(char *, rl_compentry_func_t *); +#else +extern char **completion_matches(char *, CPFunction *); #endif +#endif static void on_completion_display_matches_hook(char **matches, @@ -213,8 +217,12 @@ default completion display. */ rl_completion_display_matches_hook = completion_display_matches_hook ? +#if defined(_RL_FUNCTION_TYPEDEF) (rl_compdisp_func_t *)on_completion_display_matches_hook : 0; +#else + (VFunction *)on_completion_display_matches_hook : 0; #endif +#endif return result; } Index: Modules/_multiprocessing/multiprocessing.h =================================================================== --- Modules/_multiprocessing/multiprocessing.h (revision 67033) +++ Modules/_multiprocessing/multiprocessing.h (working copy) @@ -20,7 +20,9 @@ # define SEM_VALUE_MAX LONG_MAX #else # include /* O_CREAT and O_EXCL */ +# include # include +# include # include /* htonl() and ntohl() */ # if HAVE_SEM_OPEN # include