summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-07-02 11:11:39 +0200
committerAnatol Belski <ab@php.net>2014-07-02 11:11:39 +0200
commit49e175be422191c114f3d9a18f0e3b9c5927452e (patch)
tree6cccee46075e4502ee012d709318749cc2ed9db9
parent1e06c73192c64ecc601ad265ed5666e90048c4b4 (diff)
downloadphp-git-49e175be422191c114f3d9a18f0e3b9c5927452e.tar.gz
backported the VC12 fix for ARG_MAX
-rw-r--r--win32/glob.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/win32/glob.c b/win32/glob.c
index 1aeac78fda..8111daba1c 100644
--- a/win32/glob.c
+++ b/win32/glob.c
@@ -61,9 +61,16 @@
* Number of matches in the current invocation of glob.
*/
#ifdef PHP_WIN32
-#define _POSIX_
-#include <limits.h>
-#undef _POSIX_
+#if _MSC_VER < 1800
+# define _POSIX_
+# include <limits.h>
+# undef _POSIX_
+#else
+/* Visual Studio 2013 removed all the _POSIX_ defines, but we depend on some */
+# ifndef ARG_MAX
+# define ARG_MAX 14500
+# endif
+#endif
#ifndef S_ISDIR
#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
#endif