summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2015-07-04 18:55:22 +0200
committerKalle Sommer Nielsen <kalle@php.net>2015-07-04 18:55:22 +0200
commitce2cd89258a1c52e0ccd878165f2929718c99578 (patch)
treea1d13ec4f41a67c1ebdc0174535240de757e851c
parent550bbf8f4614a5c868010195f562be3e9ee6bb00 (diff)
downloadphp-git-ce2cd89258a1c52e0ccd878165f2929718c99578.tar.gz
Replace references to PHP_WIN32 and TSRM_WIN32 with ZEND_WIN32 in Zend/, this also fixes 1 instance of where fflush(stderr) was misplaced (zend_extensions.c)
-rw-r--r--Zend/zend_alloc.c2
-rw-r--r--Zend/zend_ast.c2
-rw-r--r--Zend/zend_compile.c2
-rw-r--r--Zend/zend_execute.c2
-rw-r--r--Zend/zend_execute_API.c2
-rw-r--r--Zend/zend_extensions.c20
-rw-r--r--Zend/zend_ini_parser.y4
-rw-r--r--Zend/zend_language_scanner.c4
-rw-r--r--Zend/zend_language_scanner.l4
-rw-r--r--Zend/zend_long.h4
-rw-r--r--Zend/zend_virtual_cwd.c71
-rw-r--r--Zend/zend_virtual_cwd.h24
12 files changed, 64 insertions, 77 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index f788737bf4..58e19c1d39 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -340,7 +340,7 @@ static ZEND_NORETURN void zend_mm_panic(const char *message)
{
fprintf(stderr, "%s\n", message);
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
#if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID)
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 58119c2598..6051fa7166 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -591,7 +591,7 @@ static void zend_ast_export_qstr(smart_str *str, char quote, zend_string *s)
case '\v':
smart_str_appends(str, "\\v");
break;
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
case VK_ESCAPE:
#else
case '\e':
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 5a15392fe9..eb1a318ea5 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1749,7 +1749,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
register char *end = path + len - 1;
unsigned int len_adjust = 0;
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
/* Note that on Win32 CWD is per drive (heritage from CP/M).
* This means dirname("c:foo") maps to "c:." or "c:" - which means CWD on C: drive.
*/
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index bbe1537b88..88d0135cfc 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1980,7 +1980,7 @@ static int zend_check_symbol(zval *pz)
if (Z_TYPE_P(pz) > 10) {
fprintf(stderr, "Warning! %x has invalid type!\n", *pz);
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
} else if (Z_TYPE_P(pz) == IS_ARRAY) {
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index dde4b20b0b..fc92494a1d 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -72,7 +72,7 @@ static void zend_handle_sigsegv(int dummy) /* {{{ */
zend_get_executed_filename(),
zend_get_executed_lineno());
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
}
diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c
index 65d215d5eb..51d6a66adc 100644
--- a/Zend/zend_extensions.c
+++ b/Zend/zend_extensions.c
@@ -35,12 +35,12 @@ int zend_load_extension(const char *path)
if (!handle) {
#ifndef ZEND_WIN32
fprintf(stderr, "Failed loading %s: %s\n", path, DL_ERROR());
-/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
- fflush(stderr);
-#endif
#else
fprintf(stderr, "Failed loading %s\n", path);
+ /* See http://support.microsoft.com/kb/190351 */
+#ifdef ZEND_WIN32
+ fflush(stderr);
+#endif
#endif
return FAILURE;
}
@@ -56,7 +56,7 @@ int zend_load_extension(const char *path)
if (!extension_version_info || !new_extension) {
fprintf(stderr, "%s doesn't appear to be a valid Zend extension\n", path);
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
DL_UNLOAD(handle);
@@ -73,7 +73,7 @@ int zend_load_extension(const char *path)
extension_version_info->zend_extension_api_no,
ZEND_EXTENSION_API_NO);
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
DL_UNLOAD(handle);
@@ -89,7 +89,7 @@ int zend_load_extension(const char *path)
new_extension->URL,
new_extension->name);
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
DL_UNLOAD(handle);
@@ -100,7 +100,7 @@ int zend_load_extension(const char *path)
fprintf(stderr, "Cannot load %s - it was built with configuration %s, whereas running engine is %s\n",
new_extension->name, extension_version_info->build_id, ZEND_EXTENSION_BUILD_ID);
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
DL_UNLOAD(handle);
@@ -108,7 +108,7 @@ int zend_load_extension(const char *path)
} else if (zend_get_extension(new_extension->name)) {
fprintf(stderr, "Cannot load %s - it was already loaded\n", new_extension->name);
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
DL_UNLOAD(handle);
@@ -119,7 +119,7 @@ int zend_load_extension(const char *path)
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
/* See http://support.microsoft.com/kb/190351 */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
fflush(stderr);
#endif
return FAILURE;
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 71aca6d26c..565d83eef8 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -29,7 +29,7 @@
#include "zend_ini_scanner.h"
#include "zend_extensions.h"
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
#include "win32/syslog.h"
#endif
@@ -179,7 +179,7 @@ static void ini_error(const char *msg)
}
if (CG(ini_parser_unbuffered_errors)) {
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
syslog(LOG_ALERT, "PHP: %s (%s)", error_buf, GetCommandLine());
#endif
fprintf(stderr, "PHP: %s", error_buf);
diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 9e2250b926..6bfe1dd7b3 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -35,7 +35,7 @@
#include <errno.h>
#include "zend.h"
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
# include <Winuser.h>
#endif
#include "zend_alloc.h"
@@ -929,7 +929,7 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
Z_STRLEN_P(zendlval)--;
break;
case 'e':
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
*t++ = VK_ESCAPE;
#else
*t++ = '\e';
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 4498edae5c..a20f7d57f6 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -33,7 +33,7 @@
#include <errno.h>
#include "zend.h"
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
# include <Winuser.h>
#endif
#include "zend_alloc.h"
@@ -927,7 +927,7 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
Z_STRLEN_P(zendlval)--;
break;
case 'e':
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
*t++ = VK_ESCAPE;
#else
*t++ = '\e';
diff --git a/Zend/zend_long.h b/Zend/zend_long.h
index 4c81105438..b2e0ee910d 100644
--- a/Zend/zend_long.h
+++ b/Zend/zend_long.h
@@ -61,7 +61,7 @@ typedef int32_t zend_off_t;
# define ZEND_ULONG_FMT "%" PRIu64
# define ZEND_LONG_FMT_SPEC PRId64
# define ZEND_ULONG_FMT_SPEC PRIu64
-# ifdef PHP_WIN32
+# ifdef ZEND_WIN32
# define ZEND_LTOA(i, s, len) _i64toa_s((i), (s), (len), 10)
# define ZEND_ATOL(i, s) i = _atoi64((s))
# define ZEND_STRTOL(s0, s1, base) _strtoi64((s0), (s1), (base))
@@ -89,7 +89,7 @@ typedef int32_t zend_off_t;
# define ZEND_ULONG_FMT "%" PRIu32
# define ZEND_LONG_FMT_SPEC PRId32
# define ZEND_ULONG_FMT_SPEC PRIu32
-# ifdef PHP_WIN32
+# ifdef ZEND_WIN32
# define ZEND_LTOA(i, s, len) _ltoa_s((i), (s), (len), 10)
# define ZEND_ATOL(i, s) i = atol((s))
# else
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index cc3fff4416..4206d4d2e8 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -34,7 +34,7 @@
#include "zend_virtual_cwd.h"
#include "tsrm_strtok_r.h"
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
#include <io.h>
#include "tsrm_win32.h"
# ifndef IO_REPARSE_TAG_SYMLINK
@@ -67,7 +67,7 @@
#include "TSRM.h"
/* Only need mutex for popen() in Windows and NetWare because it doesn't chdir() on UNIX */
-#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
+#if (defined(ZEND_WIN32) || defined(NETWARE)) && defined(ZTS)
MUTEX_T cwd_mutex;
#endif
@@ -79,13 +79,13 @@ virtual_cwd_globals cwd_globals;
cwd_state main_cwd_state; /* True global */
-#ifndef TSRM_WIN32
+#ifndef ZEND_WIN32
#include <unistd.h>
#else
#include <direct.h>
#endif
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
#include <tchar.h>
#define tsrm_strtok_r(a,b,c) _tcstok((a),(b))
#define TOKENIZER_STRING "/\\"
@@ -143,7 +143,7 @@ static int php_check_dots(const char *element, int n)
#define CWD_STATE_FREE(s) \
efree((s)->cwd);
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
# define CWD_STATE_FREE_ERR(state) do { \
DWORD last_error = GetLastError(); \
CWD_STATE_FREE(state); \
@@ -153,7 +153,7 @@ static int php_check_dots(const char *element, int n)
# define CWD_STATE_FREE_ERR(state) CWD_STATE_FREE(state)
#endif
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
#ifdef CTL_CODE
#undef CTL_CODE
@@ -466,7 +466,7 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
}
main_cwd_state.cwd_length = (int)strlen(cwd);
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
if (main_cwd_state.cwd_length >= 2 && cwd[1] == ':') {
cwd[0] = toupper(cwd[0]);
}
@@ -479,7 +479,7 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
cwd_globals_ctor(&cwd_globals);
#endif
-#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
+#if (defined(ZEND_WIN32) || defined(NETWARE)) && defined(ZTS)
cwd_mutex = tsrm_mutex_alloc();
#endif
}
@@ -490,7 +490,7 @@ CWD_API void virtual_cwd_shutdown(void) /* {{{ */
#ifndef ZTS
cwd_globals_dtor(&cwd_globals);
#endif
-#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
+#if (defined(ZEND_WIN32) || defined(NETWARE)) && defined(ZTS)
tsrm_mutex_free(cwd_mutex);
#endif
@@ -536,7 +536,7 @@ CWD_API char *virtual_getcwd_ex(size_t *length) /* {{{ */
return retval;
}
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
/* If we have something like C: */
if (state->cwd_length == 2 && state->cwd[state->cwd_length-1] == ':') {
char *retval;
@@ -588,7 +588,7 @@ CWD_API char *virtual_getcwd(char *buf, size_t size) /* {{{ */
}
/* }}} */
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
static inline zend_ulong realpath_cache_key(const char *path, int path_len) /* {{{ */
{
register zend_ulong h;
@@ -622,7 +622,7 @@ static inline zend_ulong realpath_cache_key(const char *path, int path_len) /* {
return h;
}
/* }}} */
-#endif /* defined(PHP_WIN32) */
+#endif /* defined(ZEND_WIN32) */
CWD_API void realpath_cache_clean(void) /* {{{ */
{
@@ -643,11 +643,7 @@ CWD_API void realpath_cache_clean(void) /* {{{ */
CWD_API void realpath_cache_del(const char *path, int path_len) /* {{{ */
{
-#ifdef PHP_WIN32
zend_ulong key = realpath_cache_key(path, path_len);
-#else
- zend_ulong key = realpath_cache_key(path, path_len);
-#endif
zend_ulong n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
@@ -692,11 +688,7 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
return;
}
-#ifdef PHP_WIN32
- bucket->key = realpath_cache_key(path, path_len);
-#else
bucket->key = realpath_cache_key(path, path_len);
-#endif
bucket->path = (char*)bucket + sizeof(realpath_cache_bucket);
memcpy(bucket->path, path, path_len+1);
bucket->path_len = path_len;
@@ -708,7 +700,7 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
}
bucket->realpath_len = realpath_len;
bucket->is_dir = is_dir;
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
bucket->is_rvalid = 0;
bucket->is_readable = 0;
bucket->is_wvalid = 0;
@@ -725,12 +717,7 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t) /* {{{ */
{
-#ifdef PHP_WIN32
- zend_ulong key = realpath_cache_key(path, path_len);
-#else
zend_ulong key = realpath_cache_key(path, path_len);
-#endif
-
zend_ulong n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
@@ -786,7 +773,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
{
int i, j, save;
int directory = 0;
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
WIN32_FIND_DATA data;
HANDLE hFind;
ALLOCA_FLAG(use_heap_large)
@@ -881,7 +868,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
}
}
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
if (save && (hFind = FindFirstFile(path, &data)) == INVALID_HANDLE_VALUE) {
if (use_realpath == CWD_REALPATH) {
/* file not found */
@@ -1146,7 +1133,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
path[j++] = DEFAULT_SLASH;
}
}
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
if (j < 0 || j + len - i >= MAXPATHLEN-1) {
free_alloca(tmp, use_heap);
return -1;
@@ -1196,7 +1183,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
void *tmp;
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
_set_errno(EINVAL);
#else
errno = EINVAL;
@@ -1219,7 +1206,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
} else {
int state_cwd_length = state->cwd_length;
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
if (IS_SLASH(path[0])) {
if (state->cwd[1] == ':') {
/* Copy only the drive name */
@@ -1258,7 +1245,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
}
}
} else {
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
if (path_length > 2 && path[1] == ':' && !IS_SLASH(path[2])) {
resolved_path[0] = path[0];
resolved_path[1] = ':';
@@ -1270,14 +1257,14 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
memcpy(resolved_path, path, path_length + 1);
}
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
if (memchr(resolved_path, '*', path_length) ||
memchr(resolved_path, '?', path_length)) {
return 1;
}
#endif
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
if (IS_UNC_PATH(resolved_path, path_length)) {
/* skip UNC name */
resolved_path[0] = DEFAULT_SLASH;
@@ -1339,7 +1326,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
}
resolved_path[path_length] = 0;
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
verify:
#endif
if (verify_path) {
@@ -1529,7 +1516,7 @@ CWD_API int virtual_access(const char *pathname, int mode) /* {{{ */
return -1;
}
-#if defined(TSRM_WIN32)
+#if defined(ZEND_WIN32)
ret = tsrm_win32_access(new_state.cwd, mode);
#else
ret = access(new_state.cwd, mode);
@@ -1553,7 +1540,7 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf) /* {{{ */
return -1;
}
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
ret = win32_utime(new_state.cwd, buf);
#else
ret = utime(new_state.cwd, buf);
@@ -1583,7 +1570,7 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode) /* {{{ */
}
/* }}} */
-#if !defined(TSRM_WIN32) && !defined(NETWARE)
+#if !defined(ZEND_WIN32) && !defined(NETWARE)
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link) /* {{{ */
{
cwd_state new_state;
@@ -1680,7 +1667,7 @@ CWD_API int virtual_rename(const char *oldname, const char *newname) /* {{{ */
/* rename on windows will fail if newname already exists.
MoveFileEx has to be used */
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
/* MoveFileEx returns 0 on failure, other way 'round for this function */
retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0) ? -1 : 0;
#else
@@ -1759,7 +1746,7 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode) /* {{{ */
return -1;
}
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
retval = mkdir(new_state.cwd);
#else
retval = mkdir(new_state.cwd, mode);
@@ -1787,7 +1774,7 @@ CWD_API int virtual_rmdir(const char *pathname) /* {{{ */
}
/* }}} */
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
DIR *opendir(const char *name);
#endif
@@ -1809,7 +1796,7 @@ CWD_API DIR *virtual_opendir(const char *pathname) /* {{{ */
}
/* }}} */
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
{
return popen_ex(command, type, CWDG(cwd).cwd, NULL);
diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h
index 019888757f..dd01d9cdfc 100644
--- a/Zend/zend_virtual_cwd.h
+++ b/Zend/zend_virtual_cwd.h
@@ -42,7 +42,7 @@
#define VIRTUAL_DIR
#endif
-#ifndef TSRM_WIN32
+#ifndef ZEND_WIN32
#include <unistd.h>
#else
#include <direct.h>
@@ -52,7 +52,7 @@
#include <errno.h>
#endif
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
#include "readdir.h"
#include <sys/utime.h>
/* mode_t isn't defined on Windows */
@@ -117,7 +117,7 @@ typedef unsigned short mode_t;
#define CWD_EXPORTS
#endif
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
# ifdef CWD_EXPORTS
# define CWD_API __declspec(dllexport)
# else
@@ -129,7 +129,7 @@ typedef unsigned short mode_t;
# define CWD_API
#endif
-#ifdef TSRM_WIN32
+#ifdef ZEND_WIN32
CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat);
# define php_sys_stat(path, buf) php_sys_stat_ex(path, buf, 0)
# define php_sys_lstat(path, buf) php_sys_stat_ex(path, buf, 1)
@@ -172,7 +172,7 @@ CWD_API int virtual_rmdir(const char *pathname);
CWD_API DIR *virtual_opendir(const char *pathname);
CWD_API FILE *virtual_popen(const char *command, const char *type);
CWD_API int virtual_access(const char *pathname, int mode);
-#if defined(TSRM_WIN32)
+#if defined(ZEND_WIN32)
/* these are not defined in win32 headers */
#ifndef W_OK
#define W_OK 0x02
@@ -192,7 +192,7 @@ CWD_API int virtual_access(const char *pathname, int mode);
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf);
#endif
CWD_API int virtual_chmod(const char *filename, mode_t mode);
-#if !defined(TSRM_WIN32) && !defined(NETWARE)
+#if !defined(ZEND_WIN32) && !defined(NETWARE)
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link);
#endif
@@ -219,7 +219,7 @@ typedef struct _realpath_cache_bucket {
int path_len;
int realpath_len;
int is_dir;
-#ifdef PHP_WIN32
+#ifdef ZEND_WIN32
unsigned char is_rvalid;
unsigned char is_readable;
unsigned char is_wvalid;
@@ -280,7 +280,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
#define VCWD_UTIME(path, time) virtual_utime(path, time)
#endif
#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode)
-#if !defined(TSRM_WIN32) && !defined(NETWARE)
+#if !defined(ZEND_WIN32) && !defined(NETWARE)
#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0)
#if HAVE_LCHOWN
#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1)
@@ -296,7 +296,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
#define VCWD_CREAT(path, mode) creat(path, mode)
/* rename on windows will fail if newname already exists.
MoveFileEx has to be used */
-#if defined(TSRM_WIN32)
+#if defined(ZEND_WIN32)
# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0 ? -1 : 0)
#else
# define VCWD_RENAME(oldname, newname) rename(oldname, newname)
@@ -311,7 +311,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
#define VCWD_RMDIR(pathname) rmdir(pathname)
#define VCWD_OPENDIR(pathname) opendir(pathname)
#define VCWD_POPEN(command, type) popen(command, type)
-#if defined(TSRM_WIN32)
+#if defined(ZEND_WIN32)
#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode)
#else
#define VCWD_ACCESS(pathname, mode) access(pathname, mode)
@@ -320,7 +320,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path)
#if HAVE_UTIME
-# ifdef TSRM_WIN32
+# ifdef ZEND_WIN32
# define VCWD_UTIME(path, time) win32_utime(path, time)
# else
# define VCWD_UTIME(path, time) utime(path, time)
@@ -328,7 +328,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
#endif
#define VCWD_CHMOD(path, mode) chmod(path, mode)
-#if !defined(TSRM_WIN32) && !defined(NETWARE)
+#if !defined(ZEND_WIN32) && !defined(NETWARE)
#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
#if HAVE_LCHOWN
#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group)