From: Gurusamy Sarathy Date: Mon, 16 Feb 1998 23:03:31 +0000 (+0000) Subject: [win32] fix mingw32 gcc 2.8.0 build (DLLs generated seem to be broken X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3730b96e60864694cf0c222f80e6ed2b3c27335b;p=p5sagit%2Fp5-mst-13.2.git [win32] fix mingw32 gcc 2.8.0 build (DLLs generated seem to be broken in this version of gcc!) p4raw-id: //depot/win32/perl@529 --- diff --git a/doio.c b/doio.c index d720f99..3167aea 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 # else # include diff --git a/pp_sys.c b/pp_sys.c index ce5af57..ec49864 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 # else # include diff --git a/win32/config.gc b/win32/config.gc index c8d11d8..e0617be 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 0da0797..1e6c462 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 3eeaa6a..9d819b5 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -36,7 +36,7 @@ #include #include #include -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) #include #else #include @@ -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 8d6b041..f730dea 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 d77f542..ee2c2db 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 #else # include diff --git a/x2p/a2p.h b/x2p/a2p.h index a7cbcb6..2db5f36 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