diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-16 10:13:02 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-16 10:13:02 +0100 |
commit | fd5a0b31640419ca63d1ddeaffd6d3cf2a741814 (patch) | |
tree | bfd17d84c5181d7b98d7d66f56573f4fc897e31c /win32 | |
parent | 01fcdff3849c3691d9aaeaab735846ab6d8895ca (diff) | |
download | php-fd5a0b31640419ca63d1ddeaffd6d3cf2a741814.tar.gz |
Imported Upstream version 5.3.5upstream/5.3.5
Diffstat (limited to 'win32')
-rw-r--r-- | win32/build/Makefile | 6 | ||||
-rw-r--r-- | win32/build/config.w32 | 14 | ||||
-rw-r--r-- | win32/build/config.w32.h.in | 3 | ||||
-rw-r--r-- | win32/build/template.rc | 4 | ||||
-rw-r--r-- | win32/glob.c | 60 | ||||
-rw-r--r-- | win32/php5dll.dsp | 4 | ||||
-rw-r--r-- | win32/php5dllts.dsp | 4 | ||||
-rw-r--r-- | win32/time.c | 4 | ||||
-rw-r--r-- | win32/wfile.c | 17 | ||||
-rw-r--r-- | win32/wfile.h | 16 | ||||
-rw-r--r-- | win32/winutil.c | 15 |
11 files changed, 51 insertions, 96 deletions
diff --git a/win32/build/Makefile b/win32/build/Makefile index 837fcc863..998724a17 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -14,10 +14,10 @@ # | Author: Wez Furlong <wez@thebrainroom.com> | # +----------------------------------------------------------------------+ # -# $Id: Makefile 289763 2009-10-19 19:02:12Z pajoye $ +# $Id: Makefile 302247 2010-08-15 03:38:08Z pajoye $ # This is the makefile template for the win32 build -CC="$(CL)" +CC="$(PHP_CL)" LD="$(LINK)" MC="$(MC)" MT="$(MT)" @@ -146,7 +146,7 @@ dist: all build-dist snap: build-snap build-dist $(BUILD_DIR)\deplister.exe: win32\build\deplister.c - $(CL) /Fo$(BUILD_DIR)\ /Fd$(BUILD_DIR)\ /Fp$(BUILD_DIR)\ /FR$(BUILD_DIR) /Fe$(BUILD_DIR)\deplister.exe win32\build\deplister.c imagehlp.lib + $(PHP_CL) /Fo$(BUILD_DIR)\ /Fd$(BUILD_DIR)\ /Fp$(BUILD_DIR)\ /FR$(BUILD_DIR) /Fe$(BUILD_DIR)\deplister.exe win32\build\deplister.c imagehlp.lib msi-installer: dist $(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)" diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 5f10c7e6a..a4e768fff 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -1,11 +1,11 @@ // vim:ft=javascript -// $Id: config.w32 291639 2009-12-03 11:50:32Z kalle $ +// $Id: config.w32 305923 2010-12-02 23:23:14Z pajoye $ // "Master" config file; think of it as a configure.in // equivalent. ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin'); -CL = PATH_PROG('cl'); -if (!CL) { +PHP_CL = PATH_PROG('cl', null, 'PHP_CL'); +if (!PHP_CL) { ERROR("MS C++ compiler is required"); } @@ -17,14 +17,14 @@ if (!CL) { // 1500 is vs.net 2008 // 1600 is vs.net 2010 // Which version of the compiler do we have? -VCVERS = probe_binary(CL).substr(0, 5).replace('.', ''); +VCVERS = probe_binary(PHP_CL).substr(0, 5).replace('.', ''); STDOUT.WriteLine(" Detected compiler " + VC_VERSIONS[VCVERS]); AC_DEFINE('COMPILER', VC_VERSIONS[VCVERS], "Detected compiler version"); DEFINE("PHP_COMPILER_SHORT", VC_VERSIONS_SHORT[VCVERS]); AC_DEFINE('PHP_COMPILER_ID', VC_VERSIONS_SHORT[VCVERS], "Compiler compatibility ID"); // do we use x64 or 80x86 version of compiler? -X64 = probe_binary(CL, 64); +X64 = probe_binary(PHP_CL, 64, null, 'PHP_CL'); if (X64) { STDOUT.WriteLine(" Detected 64-bit compiler"); } else { @@ -104,7 +104,7 @@ ARG_ENABLE('zts', 'Thread safety', 'yes'); // Configures the hard-coded installation dir ARG_ENABLE('prefix', 'where PHP will be installed', ''); if (PHP_PREFIX == '') { - PHP_PREFIX = "C:\\php" + PHP_VERSION; + PHP_PREFIX = "C:\\php"; if (PHP_DEBUG == "yes") PHP_PREFIX += "\\debug"; } @@ -349,7 +349,7 @@ ADD_SOURCES("main/streams", "streams.c cast.c memory.c filter.c plain_wrapper.c userspace.c transports.c xp_socket.c mmap.c glob_wrapper.c"); ADD_SOURCES("win32", "glob.c readdir.c \ - registry.c select.c sendmail.c time.c wfile.c winutil.c wsyslog.c globals.c"); + registry.c select.c sendmail.c time.c winutil.c wsyslog.c globals.c"); STDOUT.WriteBlankLines(1); diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index 27ff05258..4c16b1adc 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -1,6 +1,6 @@ /* Build Configuration Template for Win32. - $Id: config.w32.h.in 291951 2009-12-10 14:08:19Z pajoye $ + $Id: config.w32.h.in 305778 2010-11-26 18:25:13Z pajoye $ */ /* Define the minimum supported version */ @@ -58,6 +58,7 @@ /* its in win32/time.c */ #define HAVE_USLEEP 1 #define HAVE_NANOSLEEP 1 +#define PHP_SLEEP_NON_VOID 1 #define HAVE_GETHOSTNAME 1 #define HAVE_GETCWD 1 diff --git a/win32/build/template.rc b/win32/build/template.rc index 98c2bcb4f..58cbb991d 100644 --- a/win32/build/template.rc +++ b/win32/build/template.rc @@ -1,5 +1,5 @@ /* This is a template RC file. - * $Id: template.rc 281570 2009-06-03 01:14:58Z kalle $ + * $Id: template.rc 302265 2010-08-15 13:40:29Z pajoye $ * Do not edit with MSVC */ #ifdef APSTUDIO_INVOKED # error dont edit with MSVC @@ -65,7 +65,7 @@ BEGIN #endif VALUE "FileVersion", EXT_VERSION VALUE "InternalName", INTERNAL_NAME - VALUE "LegalCopyright", "Copyright © 1997-2009 The PHP Group" + VALUE "LegalCopyright", "Copyright © 1997-2010 The PHP Group" VALUE "LegalTrademarks", "PHP" VALUE "OriginalFilename", FILE_NAME VALUE "ProductName", "PHP" diff --git a/win32/glob.c b/win32/glob.c index 0d290c667..15be8ff0e 100644 --- a/win32/glob.c +++ b/win32/glob.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. */ -/* $Id: glob.c 272473 2009-01-01 12:32:49Z pajoye $ */ +/* $Id: glob.c 303317 2010-09-13 11:17:40Z pajoye $ */ /* * glob(3) -- a superset of the one defined in POSIX 1003.2. @@ -146,12 +146,11 @@ static int g_stat(Char *, struct stat *, glob_t *); static int glob0(const Char *, glob_t *); static int glob1(Char *, Char *, glob_t *, size_t *); static int glob2(Char *, Char *, Char *, Char *, Char *, Char *, - glob_t *, size_t *); + glob_t *, size_t *); static int glob3(Char *, Char *, Char *, Char *, Char *, Char *, - Char *, Char *, glob_t *, size_t *); + Char *, Char *, glob_t *, size_t *); static int globextend(const Char *, glob_t *, size_t *); -static const Char * - globtilde(const Char *, Char *, size_t, glob_t *); +static const Char *globtilde(const Char *, Char *, size_t, glob_t *); static int globexp1(const Char *, glob_t *); static int globexp2(const Char *, const Char *, glob_t *, int *); static int match(Char *, Char *, Char *); @@ -370,7 +369,7 @@ globtilde(pattern, patbuf, patbuf_len, pglob) /* Copy up to the end of the string or / */ eb = &patbuf[patbuf_len - 1]; for (p = pattern + 1, h = (char *) patbuf; - h < (char *)eb && *p && *p != SLASH; *h++ = (char) *p++) + h < (char *)eb && *p && *p != SLASH; *h++ = (char) *p++) ; *h = EOS; @@ -451,7 +450,7 @@ glob0(pattern, pglob) if (c == NOT) ++qpatnext; if (*qpatnext == EOS || - g_strchr((Char *) qpatnext+1, RBRACKET) == NULL) { + g_strchr((Char *) qpatnext+1, RBRACKET) == NULL) { *bufnext++ = LBRACKET; if (c == NOT) --qpatnext; @@ -464,7 +463,7 @@ glob0(pattern, pglob) do { *bufnext++ = CHAR(c); if (*qpatnext == RANGE && - (c = qpatnext[1]) != RBRACKET) { + (c = qpatnext[1]) != RBRACKET) { *bufnext++ = M_RNG; *bufnext++ = CHAR(c); qpatnext += 2; @@ -506,21 +505,20 @@ glob0(pattern, pglob) */ if (pglob->gl_pathc == oldpathc) { if ((pglob->gl_flags & GLOB_NOCHECK) || - ((pglob->gl_flags & GLOB_NOMAGIC) && - !(pglob->gl_flags & GLOB_MAGCHAR))) + ((pglob->gl_flags & GLOB_NOMAGIC) && + !(pglob->gl_flags & GLOB_MAGCHAR))) return(globextend(pattern, pglob, &limit)); else return(GLOB_NOMATCH); } if (!(pglob->gl_flags & GLOB_NOSORT)) qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, - pglob->gl_pathc - oldpathc, sizeof(char *), (const void *) compare); + pglob->gl_pathc - oldpathc, sizeof(char *), compare); return(0); } static int -compare(p, q) - const void *p, *q; +compare(const void *p, const void *q) { return(strcmp(*(char **)p, *(char **)q)); } @@ -537,8 +535,8 @@ glob1(pattern, pattern_last, pglob, limitp) if (*pattern == EOS) return(0); return(glob2(pathbuf, pathbuf+MAXPATHLEN-1, - pathbuf, pathbuf+MAXPATHLEN-1, - pattern, pattern_last, pglob, limitp)); + pathbuf, pathbuf+MAXPATHLEN-1, + pattern, pattern_last, pglob, limitp)); } /* @@ -548,7 +546,7 @@ glob1(pattern, pattern_last, pglob, limitp) */ static int glob2(pathbuf, pathbuf_last, pathend, pathend_last, pattern, - pattern_last, pglob, limitp) + pattern_last, pglob, limitp) Char *pathbuf, *pathbuf_last, *pathend, *pathend_last; Char *pattern, *pattern_last; glob_t *pglob; @@ -569,10 +567,10 @@ glob2(pathbuf, pathbuf_last, pathend, pathend_last, pattern, return(0); if (((pglob->gl_flags & GLOB_MARK) && - !IS_SLASH(pathend[-1])) && (S_ISDIR(sb.st_mode) || - (S_ISLNK(sb.st_mode) && - (g_stat(pathbuf, &sb, pglob) == 0) && - S_ISDIR(sb.st_mode)))) { + !IS_SLASH(pathend[-1])) && (S_ISDIR(sb.st_mode) || + (S_ISLNK(sb.st_mode) && + (g_stat(pathbuf, &sb, pglob) == 0) && + S_ISDIR(sb.st_mode)))) { if (pathend+1 > pathend_last) return (1); *pathend++ = SEP; @@ -604,15 +602,15 @@ glob2(pathbuf, pathbuf_last, pathend, pathend_last, pattern, } else /* Need expansion, recurse. */ return(glob3(pathbuf, pathbuf_last, pathend, - pathend_last, pattern, pattern_last, - p, pattern_last, pglob, limitp)); + pathend_last, pattern, pattern_last, + p, pattern_last, pglob, limitp)); } /* NOTREACHED */ } static int glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last, - restpattern, restpattern_last, pglob, limitp) + restpattern, restpattern_last, pglob, limitp) Char *pathbuf, *pathbuf_last, *pathend, *pathend_last; Char *pattern, *pattern_last, *restpattern, *restpattern_last; glob_t *pglob; @@ -642,7 +640,7 @@ glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last, if (g_Ctoc(pathbuf, buf, sizeof(buf))) return(GLOB_ABORTED); if (pglob->gl_errfunc(buf, errno) || - pglob->gl_flags & GLOB_ERR) + pglob->gl_flags & GLOB_ERR) return(GLOB_ABORTED); } return(0); @@ -677,7 +675,7 @@ glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last, continue; } err = glob2(pathbuf, pathbuf_last, --dc, pathend_last, - restpattern, restpattern_last, pglob, limitp); + restpattern, restpattern_last, pglob, limitp); if (err) break; } @@ -718,7 +716,7 @@ globextend(path, pglob, limitp) newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); + malloc(newsize); if (pathv == NULL) { if (pglob->gl_pathv) { free(pglob->gl_pathv); @@ -749,7 +747,7 @@ globextend(path, pglob, limitp) pathv[pglob->gl_offs + pglob->gl_pathc] = NULL; if ((pglob->gl_flags & GLOB_LIMIT) && - newsize + *limitp >= ARG_MAX) { + newsize + *limitp >= ARG_MAX) { errno = 0; return(GLOB_NOSPACE); } @@ -776,8 +774,8 @@ match(name, pat, patend) if (pat == patend) return(1); do - if (match(name, pat, patend)) - return(1); + if (match(name, pat, patend)) + return(1); while (*name++ != EOS) ; return(0); @@ -860,7 +858,7 @@ g_lstat(fn, sb, pglob) return(-1); if (pglob->gl_flags & GLOB_ALTDIRFUNC) return((*pglob->gl_lstat)(buf, sb)); - return(lstat(buf, sb)); + return(php_sys_lstat(buf, sb)); } static int @@ -875,7 +873,7 @@ g_stat(fn, sb, pglob) return(-1); if (pglob->gl_flags & GLOB_ALTDIRFUNC) return((*pglob->gl_stat)(buf, sb)); - return(stat(buf, sb)); + return(php_sys_stat(buf, sb)); } static Char * diff --git a/win32/php5dll.dsp b/win32/php5dll.dsp index b0fad66c2..335a0d874 100644 --- a/win32/php5dll.dsp +++ b/win32/php5dll.dsp @@ -1564,10 +1564,6 @@ SOURCE=..\ext\com\VARIANT.c # End Source File
# Begin Source File
-SOURCE=..\win32\wfile.c
-# End Source File
-# Begin Source File
-
SOURCE=..\win32\winutil.c
# End Source File
# Begin Source File
diff --git a/win32/php5dllts.dsp b/win32/php5dllts.dsp index 250d450e3..8471418ec 100644 --- a/win32/php5dllts.dsp +++ b/win32/php5dllts.dsp @@ -2403,10 +2403,6 @@ SOURCE=..\win32\time.c # End Source File
# Begin Source File
-SOURCE=..\win32\wfile.c
-# End Source File
-# Begin Source File
-
SOURCE=..\win32\winutil.c
# End Source File
# Begin Source File
diff --git a/win32/time.c b/win32/time.c index cfd4394d1..0c3ccf082 100644 --- a/win32/time.c +++ b/win32/time.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -/* $Id: time.c 273823 2009-01-19 02:35:22Z pajoye $ */ +/* $Id: time.c 305298 2010-11-12 18:37:02Z cataphract $ */ /** * @@ -105,7 +105,7 @@ PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Inf dt = (double)timer/PW32G(freq); time_Info->tv_sec = PW32G(starttime).tv_sec + (int)dt; time_Info->tv_usec = PW32G(starttime).tv_usec + (int)((dt-(int)dt)*1000000); - if (time_Info->tv_usec > 1000000) { + if (time_Info->tv_usec >= 1000000) { time_Info->tv_usec -= 1000000; ++time_Info->tv_sec; } diff --git a/win32/wfile.c b/win32/wfile.c deleted file mode 100644 index 3a5118e03..000000000 --- a/win32/wfile.c +++ /dev/null @@ -1,17 +0,0 @@ - -/* Function borrowed from the Downhill Project */ -#include "wfile.h" -#include "direct.h" - -int readlink(char *file_Name, char *buf_Mem, int buf_Size) -{ - /* See if the file exists */ - if (access(file_Name, WFILE_EXISTS) == -1) { - errno = ENOENT; - } else { - errno = EINVAL; - } - - /* Either way, it's not a link */ - return -1; -} diff --git a/win32/wfile.h b/win32/wfile.h deleted file mode 100644 index 0105e76ee..000000000 --- a/win32/wfile.h +++ /dev/null @@ -1,16 +0,0 @@ -#include <io.h> -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> - -#define access _access -#define WFILE_EXISTS 0 -#ifndef ENOENT -#define ENOENT 136 -#endif -#ifndef EINVAL -#define EINVAL 131 -#endif - -int readlink(char *, char *, int); -int checkroot(char *path); diff --git a/win32/winutil.c b/win32/winutil.c index 0dbcddfc1..bc20f78d6 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: winutil.c 300273 2010-06-08 13:00:11Z pajoye $ */ +/* $Id: winutil.c 305778 2010-11-26 18:25:13Z pajoye $ */ #include "php.h" #include <wincrypt.h> @@ -70,13 +70,10 @@ PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{ ret = CryptGenRandom(hCryptProv, size, buf); CryptReleaseContext(hCryptProv, 0); if (ret) { - while (i < size && buf[i] != 0) { - i++; - } - if (i == size) { - return SUCCESS; - } - } - return FAILURE; + return SUCCESS; + } else { + return FAILURE; + } } /* }}} */ + |