mirror of
https://github.com/php/php-src.git
synced 2025-01-20 10:43:40 +08:00
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 :-).
This commit is contained in:
parent
59ba0b5172
commit
52982c422e
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user