Fixed compilation on Windows

This commit is contained in:
Dmitry Stogov 2014-07-15 15:50:42 +04:00
parent bcc677789c
commit b4c2bd2277
5 changed files with 12 additions and 8 deletions

View file

@ -401,9 +401,11 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
/* class table hash keys, class names, properties, methods, constants, etc */ /* class table hash keys, class names, properties, methods, constants, etc */
for (idx = 0; idx < CG(class_table)->nNumUsed; idx++) { for (idx = 0; idx < CG(class_table)->nNumUsed; idx++) {
zend_class_entry *ce;
p = CG(class_table)->arData + idx; p = CG(class_table)->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue; if (Z_TYPE(p->val) == IS_UNDEF) continue;
zend_class_entry *ce = (zend_class_entry*)Z_PTR(p->val); ce = (zend_class_entry*)Z_PTR(p->val);
if (p->key) { if (p->key) {
p->key = accel_new_interned_string(p->key TSRMLS_CC); p->key = accel_new_interned_string(p->key TSRMLS_CC);

View file

@ -260,9 +260,10 @@ PHP_FUNCTION(crypt)
char salt[PHP_MAX_SALT_LEN + 1]; char salt[PHP_MAX_SALT_LEN + 1];
char *str, *salt_in = NULL; char *str, *salt_in = NULL;
int str_len, salt_in_len = 0; int str_len, salt_in_len = 0;
salt[0] = salt[PHP_MAX_SALT_LEN] = '\0';
zend_string *result; zend_string *result;
salt[0] = salt[PHP_MAX_SALT_LEN] = '\0';
/* This will produce suitable results if people depend on DES-encryption /* This will produce suitable results if people depend on DES-encryption
* available (passing always 2-character salt). At least for glibc6.1 */ * available (passing always 2-character salt). At least for glibc6.1 */
memset(&salt[1], '$', PHP_MAX_SALT_LEN - 1); memset(&salt[1], '$', PHP_MAX_SALT_LEN - 1);

View file

@ -224,14 +224,14 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
efree(transport_string); efree(transport_string);
if (stream && use_proxy && use_ssl) { if (stream && use_proxy && use_ssl) {
smart_str header = {0};
/* Set peer_name or name verification will try to use the proxy server name */ /* Set peer_name or name verification will try to use the proxy server name */
if (!context || (tmpzval = php_stream_context_get_option(context, "ssl", "peer_name")) == NULL) { if (!context || (tmpzval = php_stream_context_get_option(context, "ssl", "peer_name")) == NULL) {
ZVAL_STRING(&ssl_proxy_peer_name, resource->host); ZVAL_STRING(&ssl_proxy_peer_name, resource->host);
php_stream_context_set_option(stream->context, "ssl", "peer_name", &ssl_proxy_peer_name); php_stream_context_set_option(stream->context, "ssl", "peer_name", &ssl_proxy_peer_name);
} }
smart_str header = {0};
smart_str_appendl(&header, "CONNECT ", sizeof("CONNECT ")-1); smart_str_appendl(&header, "CONNECT ", sizeof("CONNECT ")-1);
smart_str_appends(&header, resource->host); smart_str_appends(&header, resource->host);
smart_str_appendc(&header, ':'); smart_str_appendc(&header, ':');

View file

@ -146,8 +146,9 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_
return ret; return ret;
} }
static void delete_internal_hashtable(void *data) static void delete_internal_hashtable(zval *zv)
{ {
void *data = Z_PTR_P(zv);
zend_hash_destroy(*(HashTable**)data); zend_hash_destroy(*(HashTable**)data);
free(*(HashTable**)data); free(*(HashTable**)data);
} }

View file

@ -616,8 +616,8 @@ static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char
return (res); return (res);
} }
PHPAPI zend_string *php_str_to_str(char *haystack, int length, char *needle, //???PHPAPI zend_string *php_str_to_str(char *haystack, int length, char *needle,
int needle_len, char *str, int str_len); //??? int needle_len, char *str, int str_len);
/* Escape \n. sequences /* Escape \n. sequences
* We use php_str_to_str() and not php_str_replace_in_subject(), since the latter * We use php_str_to_str() and not php_str_replace_in_subject(), since the latter