summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2012-07-12 18:07:17 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2012-07-12 18:07:17 +0100
commit8f55039992b2378df3dcb99bb2ec67d80b7c8854 (patch)
treed440bf20ae42edb8f5d51d27837fcfe1520a1269 /win32
parent20da2e5b86ba0d7b84f7fde98446cf2287b33741 (diff)
downloadperl-8f55039992b2378df3dcb99bb2ec67d80b7c8854.tar.gz
Ensure wildcard expansion is enabled for perlglob.exe on Windows
This is provided by linking in setargv.obj for Visual C++, which the makefiles already do, but for MinGW(-w64)/gcc we must explicitly ensure that wildcard expansion is enabled rather than relying on the C-runtime defaults of the particular compiler suite in question. This currently only seems to be necessary for the automated build of the MinGW-w64 cross-compiler (other builds have it enabled by default anyway), but there's no harm in making sure for others too.
Diffstat (limited to 'win32')
-rw-r--r--win32/perlglob.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/win32/perlglob.c b/win32/perlglob.c
index 5625294e44..8add30f2a5 100644
--- a/win32/perlglob.c
+++ b/win32/perlglob.c
@@ -1,8 +1,22 @@
/*
* Globbing for NT. Relies on the expansion done by the library
- * startup code.
+ * startup code (provided by Visual C++ by linking in setargv.obj).
*/
+/* Enable wildcard expansion for gcc's C-runtime library if not enabled by
+ * default (currently necessary with the automated build of the mingw-w64
+ * cross-compiler, but there's no harm in making sure for others too). */
+#ifdef __MINGW32__
+#include <_mingw.h>
+#if defined(__MINGW64_VERSION_MAJOR) && defined(__MINGW64_VERSION_MINOR)
+ // MinGW-w64
+ int _dowildcard = -1;
+#else
+ // MinGW
+ int _CRT_glob = -1;
+#endif
+#endif
+
#include <stdio.h>
#include <io.h>
#include <fcntl.h>