cvs: php4 /ext/mysql/libmysql my_tempnam.c

From: Date: Fri, 25 Apr 2003 21:31:23 +0000
Subject: cvs: php4 /ext/mysql/libmysql my_tempnam.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20501@lists.php.net to get a copy of this message
sniper Fri Apr 25 17:31:23 2003 EDT Modified files: /php4/ext/mysql/libmysql my_tempnam.c Log: - Fixed some AIX/HPUX compile issues. # Just a modified diff of the same file found in mysql 4.0.12 :) Index: php4/ext/mysql/libmysql/my_tempnam.c diff -u php4/ext/mysql/libmysql/my_tempnam.c:1.7 php4/ext/mysql/libmysql/my_tempnam.c:1.8 --- php4/ext/mysql/libmysql/my_tempnam.c:1.7 Tue Nov 12 18:34:06 2002 +++ php4/ext/mysql/libmysql/my_tempnam.c Fri Apr 25 17:31:23 2003 @@ -10,6 +10,12 @@ #include "mysys_priv.h" #include <m_string.h> + +/* HPUX 11.0 doesn't allow us to change the environ pointer */ +#ifdef HPUX11 +#undef HAVE_TEMPNAM +#endif + #include "my_static.h" #include "mysys_err.h" @@ -19,7 +25,7 @@ #endif #ifdef HAVE_TEMPNAM -#if !defined( MSDOS) && !defined(OS2) +#if !defined( MSDOS) && !defined(OS2) && !defined(__NETWARE__) extern char **environ; #endif #endif @@ -92,17 +98,23 @@ if (buffer[strlen(buffer)-1] == '\\') buffer[strlen(buffer)-1] = '\0'; putenv( buffer); -#else +#elif !defined(__NETWARE__) old_env=(char**)environ; if (dir) { /* Don't use TMPDIR if dir is given */ - ((char **)environ)=(char**)temp_env; /* May give warning */ + /* + The following strange cast is required because the IBM compiler on AIX + doesn't allow us to cast the value of environ. + The cast of environ is needed as some systems doesn't allow us to + update environ with a char ** pointer. (const mismatch) + */ + (*(char***) &environ)=(char**) temp_env; temp_env[0]=0; } #endif res=tempnam((char*) dir,(my_string) pfx); /* Use stand. dir with prefix */ -#ifndef OS2 - ((char**)environ)=(char**)old_env; /* May give warning */ +#if !defined(OS2) && !defined(__NETWARE__) + (*(char***) &environ)=(char**) old_env; #endif if (!res) DBUG_PRINT("error",("Got error: %d from tempnam",errno));

« previous php.cvs (#20501) next »