summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/Makefile8
-rw-r--r--win32/makefile.mk11
-rw-r--r--win32/perllib.c3
-rw-r--r--win32/win32.c13
-rw-r--r--win32/win32.h9
5 files changed, 27 insertions, 17 deletions
diff --git a/win32/Makefile b/win32/Makefile
index 88e270d63a..ddc7a9f856 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -589,10 +589,7 @@ CORE_NOCFG_H = \
.\include\dirent.h \
.\include\netdb.h \
.\include\sys\socket.h \
- .\win32.h \
- .\perlhost.h \
- .\vdir.h \
- .\vmem.h
+ .\win32.h
CORE_H = $(CORE_NOCFG_H) .\config.h
@@ -798,8 +795,9 @@ $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
$(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
+# This is the only file that depends on perlhost.h, vmem.h, and vdir.h
!IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
-perllib$(o) : perllib.c
+perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
$(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
!ENDIF
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 724fb6304f..fd34a06310 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -712,10 +712,7 @@ CORE_NOCFG_H = \
.\include\dirent.h \
.\include\netdb.h \
.\include\sys\socket.h \
- .\win32.h \
- .\perlhost.h \
- .\vdir.h \
- .\vmem.h
+ .\win32.h
CORE_H = $(CORE_NOCFG_H) .\config.h
@@ -1000,8 +997,10 @@ $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
# rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
-# unless the .IF is true), so instead we use a .ELSE with the default
-perllib$(o) : perllib.c
+# unless the .IF is true), so instead we use a .ELSE with the default.
+# This is the only file that depends on perlhost.h, vmem.h, and vdir.h
+
+perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
.IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
$(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
.ELSE
diff --git a/win32/perllib.c b/win32/perllib.c
index 2a0cb85c92..f240e2f0c0 100644
--- a/win32/perllib.c
+++ b/win32/perllib.c
@@ -337,6 +337,9 @@ RunPerl(int argc, char **argv, char **env)
EXTERN_C void
set_w32_module_name(void);
+#ifdef __MINGW32__
+EXTERN_C /* GCC in C++ mode mangles the name, otherwise */
+#endif
BOOL APIENTRY
DllMain(HANDLE hModule, /* DLL module handle */
DWORD fdwReason, /* reason called */
diff --git a/win32/win32.c b/win32/win32.c
index 5fb1f46545..4ccae52d84 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -15,7 +15,11 @@
#define Win32_Winsock
#endif
#include <windows.h>
-#include <shellapi.h>
+#ifndef __MINGW32__ /* GCC/Mingw32-2.95.2 forgot the WINAPI on CommandLineToArgvW() */
+# include <shellapi.h>
+#else
+ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCommandLine, int * pNumArgs);
+#endif
#include <winnt.h>
#include <io.h>
@@ -58,7 +62,12 @@ int _CRT_glob = 0;
#endif
#if defined(__MINGW32__)
-# define _stat stat
+/* Mingw32 is missing some prototypes */
+FILE * _wfopen(LPCWSTR wszFileName, LPCWSTR wszMode);
+FILE * _wfdopen(int nFd, LPCWSTR wszMode);
+FILE * _freopen(LPCWSTR wszFileName, LPCWSTR wszMode, FILE * pOldStream);
+int _flushall();
+int _fcloseall();
#endif
#if defined(__BORLANDC__)
diff --git a/win32/win32.h b/win32/win32.h
index b0ccd14d9f..a0d076109c 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -211,10 +211,6 @@ typedef long gid_t;
#define flushall _flushall
#define fcloseall _fcloseall
-#ifndef CP_UTF8
-# define CP_UTF8 65001
-#endif
-
#ifdef PERL_OBJECT
# define MEMBER_TO_FPTR(name) &(name)
#endif
@@ -228,6 +224,11 @@ typedef long gid_t;
#endif /* __MINGW32__ */
+/* both GCC/Mingw32 and MSVC++ 4.0 are missing this, so we put it here */
+#ifndef CP_UTF8
+# define CP_UTF8 65001
+#endif
+
/* compatibility stuff for other compilers goes here */