]> granicus.if.org Git - php/commitdiff
This should help with some build problems/warnings under win32.
authorWez Furlong <wez@php.net>
Sat, 16 Mar 2002 02:33:00 +0000 (02:33 +0000)
committerWez Furlong <wez@php.net>
Sat, 16 Mar 2002 02:33:00 +0000 (02:33 +0000)
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 :-).

ext/ftp/php_ftp.c
ext/standard/file.c
ext/standard/fsock.c
ext/standard/html.c
main/php_network.h

index 9d2673360a02e7944baea5323db2a36b889fe36a..3706dd7cb99747bf449d9a8f13635811cede96ee 100644 (file)
@@ -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;
index 593d943a1976cca717d9853b27a2ff7f02fecbb1..88b1798c26e37190084e7234c5c49f1debda82cf 100644 (file)
@@ -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)
index dfadc5e0fde8ff6116857f559e674ea4e7301acc..530dcdd21a9dcaad7ebda8e936b5fc99710c6250 100644 (file)
@@ -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)     {
index 09c6f537a401643eacf21fdb1a0609bd855445d1..76f40d5c6511b0a62c62e242e6e6760979b4631f 100644 (file)
@@ -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;
index 98bdffa7032599a1f1350240a95478fe3a00c484..a9a4bc16234a03ac6d44107614256df3b86afc09 100644 (file)
 #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>
 #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