summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/win32/perlglob.c
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2014-03-24 15:05:12 +0000
committerafresh1 <afresh1@openbsd.org>2014-03-24 15:05:12 +0000
commite9ce384231aabe5c5a622aa68cef46f2c5bfdb4a (patch)
tree5029388537325eaad6674da4dab6714cda1644e5 /gnu/usr.bin/perl/win32/perlglob.c
parentImport perl-5.18.2 (diff)
downloadwireguard-openbsd-e9ce384231aabe5c5a622aa68cef46f2c5bfdb4a.tar.xz
wireguard-openbsd-e9ce384231aabe5c5a622aa68cef46f2c5bfdb4a.zip
Merge perl-5.18.2 plus local patches, remove old files
OK espie@ sthen@ deraadt@
Diffstat (limited to 'gnu/usr.bin/perl/win32/perlglob.c')
-rw-r--r--gnu/usr.bin/perl/win32/perlglob.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/win32/perlglob.c b/gnu/usr.bin/perl/win32/perlglob.c
index 5625294e44d..8add30f2a52 100644
--- a/gnu/usr.bin/perl/win32/perlglob.c
+++ b/gnu/usr.bin/perl/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>