summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doio.c2
-rw-r--r--pp_sys.c2
-rw-r--r--win32/config.gc2
-rw-r--r--win32/makefile.mk14
-rw-r--r--win32/win32.c6
-rw-r--r--win32/win32.h6
-rw-r--r--win32/win32iop.h2
-rw-r--r--x2p/a2p.h8
8 files changed, 23 insertions, 19 deletions
diff --git a/doio.c b/doio.c
index d720f99d04..3167aea6b7 100644
--- a/doio.c
+++ b/doio.c
@@ -34,7 +34,7 @@
#endif
#ifdef I_UTIME
-# ifdef _MSC_VER
+# if defined(_MSC_VER) || defined(__MINGW32__)
# include <sys/utime.h>
# else
# include <utime.h>
diff --git a/pp_sys.c b/pp_sys.c
index ce5af57ab7..ec49864120 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -79,7 +79,7 @@ extern int h_errno;
#endif
#ifdef I_UTIME
-# ifdef _MSC_VER
+# if defined(_MSC_VER) || defined(__MINGW32__)
# include <sys/utime.h>
# else
# include <utime.h>
diff --git a/win32/config.gc b/win32/config.gc
index c8d11d88ca..e0617be2ab 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -372,7 +372,7 @@ known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_
ksh=''
large=''
ld='gcc'
-lddlflags='-dll ~LINK_FLAGS~'
+lddlflags='-mdll ~LINK_FLAGS~'
ldflags='~LINK_FLAGS~'
less='less'
lib_ext='.lib'
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 0da079784a..1e6c462573 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -23,8 +23,8 @@ INST_TOP *= $(INST_DRV)\perl5004.5x
# uncomment one
#CCTYPE *= MSVC20
#CCTYPE *= MSVC
-CCTYPE *= BORLAND
-#CCTYPE *= GCC
+#CCTYPE *= BORLAND
+CCTYPE *= GCC
#
# uncomment next line if you want debug version of perl (big,slow)
@@ -43,8 +43,8 @@ CCTYPE *= BORLAND
#
# set the install locations of the compiler include/libraries
#CCHOME *= f:\msdev\vc
-CCHOME *= C:\bc5
-#CCHOME *= C:\mingw32
+#CCHOME *= C:\bc5
+CCHOME *= D:\packages\mingw32
CCINCDIR *= $(CCHOME)\include
CCLIBDIR *= $(CCHOME)\lib
@@ -227,7 +227,7 @@ o *= .obj
.SUFFIXES : .c $(o) .dll .lib .exe .a
.c$(o):
- $(CC) -c -I$(<:d) $(CFLAGS) $(OBJOUT_FLAG)$@ $<
+ $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS) $(OBJOUT_FLAG)$@ $<
.y.c:
$(NOOP)
@@ -552,7 +552,7 @@ $(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
perldll.def\n)
$(IMPLIB) $*.lib $@
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -dll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \
+ $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \
$(mktmp $(LKPRE) $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\) \
$(DLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
dlltool --output-lib $(PERLIMPLIB) \
@@ -560,7 +560,7 @@ $(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
--def perldll.def \
--base-file perl.base \
--output-exp perl.exp
- $(LINK32) -dll -o $@ $(LINK_FLAGS) \
+ $(LINK32) -mdll -o $@ $(LINK_FLAGS) \
$(mktmp $(LKPRE) $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\) \
$(DLL_OBJ:s,\,\\) $(LIBFILES) perl.exp $(LKPOST))
.ELSE
diff --git a/win32/win32.c b/win32/win32.c
index 3eeaa6a988..9d819b518f 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -36,7 +36,7 @@
#include <stdarg.h>
#include <float.h>
#include <time.h>
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
#include <sys/utime.h>
#else
#include <utime.h>
@@ -1193,7 +1193,7 @@ win32_strerror(int e)
}
DllExport void
-win32_str_os_error(SV *sv, unsigned long dwErr)
+win32_str_os_error(void *sv, DWORD dwErr)
{
DWORD dwLen;
char *sMsg;
@@ -1214,7 +1214,7 @@ win32_str_os_error(SV *sv, unsigned long dwErr)
"Unknown error #0x%lX (lookup 0x%lX)",
dwErr, GetLastError());
}
- sv_setpvn(sv, sMsg, dwLen);
+ sv_setpvn((SV*)sv, sMsg, dwLen);
LocalFree(sMsg);
}
diff --git a/win32/win32.h b/win32/win32.h
index 8d6b04197d..f730dea3aa 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -133,6 +133,9 @@ typedef long gid_t;
typedef long uid_t;
typedef long gid_t;
+#define _environ environ
+#define flushall _flushall
+#define fcloseall _fcloseall
#endif /* __MINGW32__ */
@@ -161,7 +164,8 @@ extern char * getlogin(void);
DllExport void Perl_win32_init(int *argcp, char ***argvp);
DllExport void Perl_init_os_extras(void);
-DllExport void win32_str_os_error(struct sv *s, DWORD err);
+/*DllExport void win32_str_os_error(struct sv *s, DWORD err);*/
+DllExport void win32_str_os_error(void *sv, DWORD err);
#ifndef USE_SOCKETS_AS_HANDLES
extern FILE * my_fdopen(int, char *);
diff --git a/win32/win32iop.h b/win32/win32iop.h
index d77f542500..ee2c2dbfa1 100644
--- a/win32/win32iop.h
+++ b/win32/win32iop.h
@@ -13,7 +13,7 @@
#endif
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
# include <sys/utime.h>
#else
# include <utime.h>
diff --git a/x2p/a2p.h b/x2p/a2p.h
index a7cbcb68b3..2db5f36ebc 100644
--- a/x2p/a2p.h
+++ b/x2p/a2p.h
@@ -20,6 +20,10 @@
# include "../config.h"
#endif
+#if defined(__STDC__) || defined(vax11c) || defined(_AIX) || defined(__stdc__) || defined(__cplusplus)
+# define STANDARD_C 1
+#endif
+
#ifdef WIN32
#undef USE_STDIO_PTR /* XXX fast gets won't work, must investigate */
# ifndef STANDARD_C
@@ -40,10 +44,6 @@
# endif
#endif
-#if defined(__STDC__) || defined(vax11c) || defined(_AIX) || defined(__stdc__) || defined(__cplusplus)
-# define STANDARD_C 1
-#endif
-
/* Use all the "standard" definitions? */
#if defined(STANDARD_C) && defined(I_STDLIB)
# include <stdlib.h>