diff options
author | Wez Furlong <wez@php.net> | 2002-03-16 02:33:00 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-03-16 02:33:00 +0000 |
commit | 52982c422e96c1264ce06474fe8ddb504a54d0f0 (patch) | |
tree | c6ece52a461d7106ef93c8cc7136484ceb7fb814 | |
parent | 59ba0b5172672b1a68b8be745409bf057cbfceac (diff) | |
download | php-git-52982c422e96c1264ce06474fe8ddb504a54d0f0.tar.gz |
This should help with some build problems/warnings under win32.
Someone still needs to add the streams.c file to the MSVC
project/workspace though (there are so many that I don't really know
what I am doing :-).
-rw-r--r-- | ext/ftp/php_ftp.c | 4 | ||||
-rw-r--r-- | ext/standard/file.c | 2 | ||||
-rw-r--r-- | ext/standard/fsock.c | 2 | ||||
-rw-r--r-- | ext/standard/html.c | 7 | ||||
-rw-r--r-- | main/php_network.h | 9 |
5 files changed, 17 insertions, 7 deletions
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 9d2673360a..3706dd7cb9 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -480,7 +480,7 @@ PHP_FUNCTION(ftp_get) RETURN_FALSE; } - outstream = php_stream_fopen(local, "wb", NULL TSRMLS_C); + outstream = php_stream_fopen(local, "wb", NULL TSRMLS_CC); if (outstream == NULL) { php_stream_close(tmpstream); @@ -547,7 +547,7 @@ PHP_FUNCTION(ftp_put) ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); XTYPE(xtype, mode); - instream = php_stream_fopen(local, "rb", NULL TSRMLS_C); + instream = php_stream_fopen(local, "rb", NULL TSRMLS_CC); if (instream == NULL) { RETURN_FALSE; diff --git a/ext/standard/file.c b/ext/standard/file.c index 593d943a19..88b1798c26 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1284,7 +1284,9 @@ static size_t php_passthru_stream(php_stream *stream TSRMLS_DC) size_t bcount = 0; int ready = 0; char buf[8192]; +#ifdef HAVE_MMAP int fd; +#endif #ifdef HAVE_MMAP if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET) diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index dfadc5e0fd..530dcdd21a 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -193,7 +193,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) } else #endif - stream = php_stream_sock_open_host(host, port, socktype, timeout, persistent); + stream = php_stream_sock_open_host(host, port, socktype, (int)timeout, persistent); #if HAVE_OPENSSL_EXT if (stream) { diff --git a/ext/standard/html.c b/ext/standard/html.c index 09c6f537a4..76f40d5c65 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -408,11 +408,10 @@ static enum entity_charset determine_charset(char *charset_hint) */ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *newlen, int all, int quote_style, char *hint_charset) { - int i, maxlen, len, retlen; + int retlen; int j, k; char *replaced, *ret; enum entity_charset charset = determine_charset(hint_charset); - int matches_map; unsigned char replacement[15]; ret = estrdup(old); @@ -457,7 +456,7 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new if (basic_entities[j].flags && (quote_style & basic_entities[j].flags) == 0) continue; - replacement[0] = basic_entities[j].charcode; + replacement[0] = (unsigned char)basic_entities[j].charcode; replacement[1] = '\0'; replaced = php_str_to_str(ret, retlen, basic_entities[j].entity, basic_entities[j].entitylen, replacement, 1, &retlen); @@ -674,7 +673,7 @@ PHP_FUNCTION(get_html_translation_table) if (basic_entities[j].flags && (quote_style & basic_entities[j].flags) == 0) continue; - ind[0] = basic_entities[j].charcode; + ind[0] = (unsigned char)basic_entities[j].charcode; add_assoc_string(return_value, ind, basic_entities[j].entity, 1); } break; diff --git a/main/php_network.h b/main/php_network.h index 98bdffa703..a9a4bc1623 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -37,6 +37,11 @@ #define shutdown(s,n) /* nothing */ #endif +#ifdef PHP_WIN32 +#define EWOULDBLOCK WSAEWOULDBLOCK +# define fsync _commit +# define ftruncate(a, b) chsize(a, b) +#endif /* defined(PHP_WIN32) */ #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> @@ -54,6 +59,10 @@ #include <openssl/ssl.h> #endif +#ifdef HAVE_STDDEF_H +#include <stddef.h> +#endif + #ifdef HAVE_SOCKADDR_STORAGE typedef struct sockaddr_storage php_sockaddr_storage; #else |