diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c index 2cdc381..22d27ad 100644 --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -33,7 +33,11 @@ # define dirent dirent64 # if !defined(HAVE_DIRFD) /* Some versions of Solaris lack dirfd(). */ -# define dirfd(dirp) ((dirp)->dd_fd) +# if defined(__XOPEN_OR_POSIX) +# define dirfd(dirp) ((dirp)->d_fd) +# else +# define dirfd(dirp) ((dirp)->dd_fd) +# endif # define HAVE_DIRFD # endif #endif diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index bae9634..ef813eb 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -291,6 +291,19 @@ if_indextoname(index) -- return the corresponding interface name\n\ #endif +/* Solaris 9 and 10 provide the sethostname prototype only + * its manpage, but forget to include it in unistd.h ... */ +#if defined(sun) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +/* not defined when compiling with gcc, and declaration + * doesn't hurt for Solaris > 5.10 */ +/* # if defined(__SunOS_5_9) || defined(__SunOS_5_10) */ +int sethostname(char *name, int namelen); +/* # endif */ +# endif +#endif + + #include #ifndef O_NONBLOCK diff --git a/setup.py b/setup.py index da67731..7132e9c 100644 --- a/setup.py +++ b/setup.py @@ -1294,7 +1294,11 @@ class PyBuildExt(build_ext): panel_library = 'panel' if curses_library == 'ncursesw': curses_defines.append(('HAVE_NCURSESW', '1')) - curses_includes.append('/usr/include/ncursesw') + if host_platform == 'sunos5': + curses_defines.append(('_XOPEN_SOURCE', '600')) + curses_includes.append('/opt/csw/include/ncursesw') + else: + curses_includes.append('/usr/include/ncursesw') # Bug 1464056: If _curses.so links with ncursesw, # _curses_panel.so must link with panelw. panel_library = 'panelw'