com php-src: windows fixes: ext/standard/string.c win32/build/config.w32 win32/registry.c
| From: | Anatol Belski | Date: | Thu, 04 Jul 2013 11:27:40 +0000 |
| Subject: | com php-src: windows fixes: ext/standard/string.c win32/build/config.w32 win32/registry.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73662@lists.php.net to get a copy of this message | ||
Commit: ca0e018c9567b1e6eb483710ca025c73a2bd41e5
Author: Anatol Belski <ab@php.net> Thu, 4 Jul 2013 04:27:40 -0700
Parents: f4c4fe417a051b7376e4b5277ba0fe2c19403bf3
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ca0e018c9567b1e6eb483710ca025c73a2bd41e5
Log:
windows fixes
Changed paths:
M ext/standard/string.c
M win32/build/config.w32
M win32/registry.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 71f43f2..a8931d3 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1413,7 +1413,7 @@ PHP_FUNCTION(strtolower)
PHPAPI void php_basename(const char *s, zend_str_size_size_t len, char *suffix,
zend_str_size_size_t sufflen, char **p_ret, zend_str_size_size_t *p_len TSRMLS_DC)
{
char *ret = NULL, *c, *comp, *cend;
- zend_str_size inc_len, cnt;
+ zend_str_size_size_t inc_len, cnt;
int state;
c = comp = cend = (char*)s;
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 3face08..ada6eba 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -449,3 +449,9 @@ if (PHP_STATIC_ANALYZE == "yes") {
ADD_FLAG("CFLAGS", " /analyze ");
ADD_FLAG("CFLAGS", " /wd6308 ");
}
+
+ARG_ENABLE("zstrlen", "Include Z_STRLEN macros enabling size_t for string
length", "no");
+if (PHP_ZSTRLEN == "yes") {
+ AC_DEFINE('ZEND_USE_LEGACY_STRING_TYPES', 1, "");
+}
+
diff --git a/win32/registry.c b/win32/registry.c
index 685a09d..f646a97 100644
--- a/win32/registry.c
+++ b/win32/registry.c
@@ -90,7 +90,7 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_
}
INIT_PZVAL(data);
Z_STRVAL_P(data) = zend_strndup(value, value_len-1);
- Z_STRLEN_P(data) = value_len-1;
+ Z_STRSIZE_P(data) = value_len-1;
Z_TYPE_P(data) = IS_STRING;
zend_hash_update(ht, name, name_len+1, &data, sizeof(zval*), NULL);
}
@@ -261,7 +261,7 @@ void UpdateIniFromRegistry(char *path TSRMLS_DC)
zend_hash_get_current_data_ex(ht, (void**)&data, &pos) == SUCCESS &&
zend_hash_get_current_key_ex(ht, &index, &index_len, &num, 0, &pos) ==
HASH_KEY_IS_STRING;
zend_hash_move_forward_ex(ht, &pos)) {
- zend_alter_ini_entry(index, index_len, Z_STRVAL_PP(data), Z_STRLEN_PP(data), PHP_INI_SYSTEM,
PHP_INI_STAGE_ACTIVATE);
+ zend_alter_ini_entry(index, index_len, Z_STRVAL_PP(data), Z_STRSIZE_PP(data), PHP_INI_SYSTEM,
PHP_INI_STAGE_ACTIVATE);
}
break;
}