From: Martin v. Löwis Date: Thu, 19 Sep 2002 08:03:21 +0000 (+0000) Subject: Patch #608999: Fix portability problems with MIPSPro 7.x X-Git-Tag: v2.3c1~4021 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8eb92a014be020c99dad91ad2f7a8cbdcfa33d86;p=thirdparty%2FPython%2Fcpython.git Patch #608999: Fix portability problems with MIPSPro 7.x --- diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c index bd089191142e..1908a2db653d 100644 --- a/Modules/_hotshot.c +++ b/Modules/_hotshot.c @@ -55,6 +55,12 @@ typedef struct timeval hs_time; #define PATH_MAX 260 #endif +#if defined(__sgi) && _COMPILER_VERSION>700 && !defined(PATH_MAX) +/* fix PATH_MAX not being defined with MIPSPro 7.x + if mode is ANSI C (default) */ +#define PATH_MAX 1024 +#endif + #ifndef PATH_MAX # ifdef MAX_PATH # define PATH_MAX MAX_PATH diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index f0e3f0d86c67..9ac0eb4993e2 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -129,6 +129,12 @@ extern int lstat(const char *, struct stat *); extern int symlink(const char *, const char *); #endif +#if defined(__sgi)&&_COMPILER_VERSION>=700 +/* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode + (default) */ +extern char *ctermid_r(char *); +#endif + #ifndef HAVE_UNISTD_H #if defined(PYCC_VACPP) extern int mkdir(char *); diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index a790900d2594..bdeddea0c719 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -155,6 +155,14 @@ shutdown(how) -- shut down traffic in one or both directions\n\ # include #endif +#if defined(__sgi)&&_COMPILER_VERSION>700 && !_SGIAPI +/* make sure that the reentrant (gethostbyaddr_r etc) + functions are declared correctly if compiling with + MIPSPro 7.x in ANSI C mode (default) */ +#define _SGIAPI 1 +#include "netdb.h" +#endif + /* Generic includes */ #include #include