From: Nick Ing-Simmons Date: Sat, 20 Jun 1998 21:05:51 +0000 (+0000) Subject: Patches to build with EGCS-1.0.2 Mingw32 port. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e61ee4d2394e4b120037f733150ee6041bf95f2;p=p5sagit%2Fp5-mst-13.2.git Patches to build with EGCS-1.0.2 Mingw32 port. p4raw-id: //depot/ansiperl@1160 --- diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index fd27b11..a4fd52e 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -275,8 +275,10 @@ unsigned long strtoul _((const char *, char **, int)); extern char *tzname[]; # endif #else +#if !defined(__GNUC__) && !defined(tzname) char *tzname[] = { "" , "" }; #endif +#endif /* XXX struct tm on some systems (SunOS4/BSD) contains extra (non POSIX) * fields for which we don't have Configure support yet: diff --git a/win32/config_H.gc b/win32/config_H.gc index 9c674b6..16fab75 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -1066,7 +1066,7 @@ /* MYMALLOC: * This symbol, if defined, indicates that we're using our own malloc. */ -#define MYMALLOC /**/ +/*#define MYMALLOC /**/ /* CAN_PROTOTYPE: * If defined, this macro indicates that the C compiler can handle diff --git a/win32/dl_win32.xs b/win32/dl_win32.xs index d721731..a5183c3 100644 --- a/win32/dl_win32.xs +++ b/win32/dl_win32.xs @@ -26,6 +26,7 @@ calls. #include "EXTERN.h" #include "perl.h" +#include "win32.h" #ifdef PERL_OBJECT #define NO_XSLOCKS @@ -33,6 +34,19 @@ calls. #include "XSUB.h" +static SV *error_sv; + +static char * +OS_Error_String(void) +{ + DWORD err = GetLastError(); + STRLEN len; + if (!error_sv) + error_sv = newSVpv("",0); + win32_str_os_error(error_sv,err); + return SvPV(error_sv,len); +} + #include "dlutils.c" /* SaveError() etc */ static void @@ -96,7 +110,7 @@ dl_load_file(filename,flags=0) DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL)); ST(0) = sv_newmortal() ; if (RETVAL == NULL) - SaveError(PERL_OBJECT_THIS_ "%d",GetLastError()) ; + SaveError(PERL_OBJECT_THIS_ "load_file:%s",OS_Error_String()) ; else sv_setiv( ST(0), (IV)RETVAL); @@ -112,7 +126,7 @@ dl_find_symbol(libhandle, symbolname) DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref = %x\n", RETVAL)); ST(0) = sv_newmortal() ; if (RETVAL == NULL) - SaveError(PERL_OBJECT_THIS_ "%d",GetLastError()) ; + SaveError(PERL_OBJECT_THIS_ "find_symbol:%s",OS_Error_String()) ; else sv_setiv( ST(0), (IV)RETVAL); diff --git a/win32/makefile.mk b/win32/makefile.mk index 0fb6734..35004f8 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -42,7 +42,7 @@ CCTYPE *= GCC # # uncomment next line if you want debug version of perl (big,slow) -#CFG *= Debug +CFG *= Debug # # if you have the source for des_fcrypt(), uncomment this and make sure the @@ -62,7 +62,7 @@ CCTYPE *= GCC # you may have compiled with/without it. Be prepared to recompile all extensions # if you change the default. Currently, this cannot be enabled if you ask for # PERL_OBJECT above. -PERL_MALLOC *= define +#PERL_MALLOC *= define # # set the install locations of the compiler include/libraries diff --git a/win32/win32.h b/win32/win32.h index a6a2f9d..eaced28 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -31,9 +31,6 @@ typedef long long __int64; #define __declspec(x) #define PERL_GLOBAL_STRUCT #define MULTIPLICITY -#ifndef TLS_OUT_OF_INDEXES -#define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF -#endif #endif /* Define DllExport akin to perl's EXT, @@ -60,6 +57,10 @@ typedef long long __int64; #define CONTEXT PERL_CONTEXT /* Avoid conflict of CONTEXT defs. */ #endif /*WIN32_LEAN_AND_MEAN */ +#ifndef TLS_OUT_OF_INDEXES +#define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF +#endif + #include #include #include