From 14d9a59f1cbc9c8f9cf9e4d955549dc8c1fc7334 Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Sun, 5 Sep 1999 19:04:40 +0000 Subject: [PATCH] - Make dir functions compile in Win32 - Fix too early memory manager initialization (For you Thies) --- ext/session/mod_files.c | 6 ++++++ ext/standard/basic_functions.c | 13 +++++++++---- ext/standard/dir.c | 4 +--- main/SAPI.c | 1 + php4dll.dsp | 12 ++++++++++++ win32/readdir.h | 9 +++++---- 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index a12c954e986..ebddd47ab66 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -30,6 +30,12 @@ #include #endif +#if WIN32||WINNT +#define NEEDRDH 1 +#include "win32/readdir.h" +#include +#endif + #include #include "php_session.h" diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 9af58daa602..a219fc2002f 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1629,9 +1629,9 @@ PHP_FUNCTION(set_magic_quotes_runtime) if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &new_setting)==FAILURE) { RETURN_FALSE; } - convert_to_long(new_setting); + convert_to_boolean(new_setting); - PG(magic_quotes_runtime)=new_setting->value.lval; + PG(magic_quotes_runtime) = (zend_bool) new_setting->value.lval; RETURN_TRUE; } @@ -2346,6 +2346,8 @@ PHP_FUNCTION(defined) Returns true if client disconnected */ PHP_FUNCTION(connection_aborted) { + PLS_FETCH(); + RETURN_LONG(PG(connection_status)&PHP_CONNECTION_ABORTED); } /* }}} */ @@ -2354,6 +2356,7 @@ PHP_FUNCTION(connection_aborted) Returns true if script timed out */ PHP_FUNCTION(connection_timeout) { + PLS_FETCH(); RETURN_LONG(PG(connection_status)&PHP_CONNECTION_TIMEOUT); } @@ -2363,6 +2366,7 @@ PHP_FUNCTION(connection_timeout) Returns the connection status bitfield */ PHP_FUNCTION(connection_status) { + PLS_FETCH(); RETURN_LONG(PG(connection_status)); } @@ -2374,6 +2378,7 @@ PHP_FUNCTION(ignore_user_abort) { pval *arg; int old_setting; + PLS_FETCH(); old_setting = PG(ignore_user_abort); switch (ARG_COUNT(ht)) { @@ -2383,8 +2388,8 @@ PHP_FUNCTION(ignore_user_abort) if (getParameters(ht,1,&arg) == FAILURE) { RETURN_FALSE; } - convert_to_long(arg); - PG(ignore_user_abort)=arg->value.lval; + convert_to_boolean(arg); + PG(ignore_user_abort) = (zend_bool) arg->value.lval; break; default: WRONG_PARAM_COUNT; diff --git a/ext/standard/dir.c b/ext/standard/dir.c index dc5705913b0..21880d82203 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -33,10 +33,8 @@ #include -#if MSVC5 -#if !(APACHE) +#if WIN32||WINNT #define NEEDRDH 1 -#endif #include "win32/readdir.h" #endif diff --git a/main/SAPI.c b/main/SAPI.c index be6a2d5bb3a..2c749daae59 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -20,6 +20,7 @@ #include +#include "php.h" #include "SAPI.h" #ifdef ZTS #include "TSRM.h" diff --git a/php4dll.dsp b/php4dll.dsp index a55ee886c5c..f55a892cf17 100644 --- a/php4dll.dsp +++ b/php4dll.dsp @@ -327,6 +327,10 @@ SOURCE=.\ext\standard\iptc.c # End Source File # Begin Source File +SOURCE=.\ext\standard\lcg.c +# End Source File +# Begin Source File + SOURCE=.\ext\standard\link.c # End Source File # Begin Source File @@ -347,6 +351,10 @@ SOURCE=.\ext\standard\microtime.c # End Source File # Begin Source File +SOURCE=.\ext\session\mod_files.c +# End Source File +# Begin Source File + SOURCE=.\ext\bcmath\number.c # End Source File # Begin Source File @@ -383,6 +391,10 @@ SOURCE=.\ext\standard\reg.c # End Source File # Begin Source File +SOURCE=.\ext\session\session.c +# End Source File +# Begin Source File + SOURCE=.\ext\standard\soundex.c # End Source File # Begin Source File diff --git a/win32/readdir.h b/win32/readdir.h index febaff27988..d7edb586f53 100644 --- a/win32/readdir.h +++ b/win32/readdir.h @@ -30,8 +30,9 @@ typedef struct { } DIR; /* Function prototypes */ -extern DIR *opendir(const char *); -extern struct dirent *readdir(DIR *); -extern int closedir(DIR *); +DIR *opendir(const char *); +struct dirent *readdir(DIR *); +int closedir(DIR *); +void rewinddir(DIR *); + #endif -extern void rewinddir(DIR *);