]> granicus.if.org Git - php/commitdiff
Replace references to PHP_WIN32 and TSRM_WIN32 with ZEND_WIN32 in Zend/, this also...
authorKalle Sommer Nielsen <kalle@php.net>
Sat, 4 Jul 2015 16:55:22 +0000 (18:55 +0200)
committerKalle Sommer Nielsen <kalle@php.net>
Sat, 4 Jul 2015 16:55:22 +0000 (18:55 +0200)
12 files changed:
Zend/zend_alloc.c
Zend/zend_ast.c
Zend/zend_compile.c
Zend/zend_execute.c
Zend/zend_execute_API.c
Zend/zend_extensions.c
Zend/zend_ini_parser.y
Zend/zend_language_scanner.c
Zend/zend_language_scanner.l
Zend/zend_long.h
Zend/zend_virtual_cwd.c
Zend/zend_virtual_cwd.h

index f788737bf48166022cae7e536bc9049f60702eb9..58e19c1d395d14bf807bb64ad86a30b67aecb474 100644 (file)
@@ -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)
index 58119c2598252e8792bdda4f478b57f1eea7bda1..6051fa71662937c61ea0d4a8f16631bfde6fd0cb 100644 (file)
@@ -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':
index 5a15392fe94747347c900066e8508217698137c2..eb1a318ea517f8faf1866d9d25dd72ebf3aa10bf 100644 (file)
@@ -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.
         */
index bbe1537b888f8c57317cbf154b601736d324f5be..88d0135cfcc7b628d3da40327e8fa4e0b9782e2c 100644 (file)
@@ -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) {
index dde4b20b0bbbf88f9b9125e4bd7444cc565da71a..fc92494a1d5f8342045915be9cf1118124a74613 100644 (file)
@@ -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
        }
index 65d215d5eb9689231c5402d18927586eaf1fdd7b..51d6a66adcd85ef1fa4672fce94fe765259ba83e 100644 (file)
@@ -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;
index 71aca6d26c0e03e3af4d0c81848a8054630250da..565d83eef820b18d55a9e2fdf8db64b939242855 100644 (file)
@@ -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);
index 9e2250b9265348e0180f1079560a77b575e21613..6bfe1dd7b376e6635836604b70cd35237535e3a5 100644 (file)
@@ -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';
index 4498edae5c6e26fc9e09da08408a8543828d5ee0..a20f7d57f6fb1a37d044a2c627af062cb61647d9 100644 (file)
@@ -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';
index 4c811054382bd7479b99aa006304d398e6c52706..b2e0ee910d3e38d2077e3f47b96f4bb53d1184dc 100644 (file)
@@ -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
index cc3fff44162950a3a09540e7626c3b6390e485e3..4206d4d2e8fd099d29e7d95f0474781452f568fc 100644 (file)
@@ -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);
index 019888757f1aca74f14b33db0f186c75332c7654..dd01d9cdfc2c034caf4973acf3aeb71b73e1aaab 100644 (file)
@@ -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)