From: Steve Peters Date: Mon, 30 Oct 2006 13:58:15 +0000 (+0000) Subject: Initial cleanups to support compiling Win32 with MinGW g++. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d06fc7d4ca982fb56f0bbeb3d160a8e6c2f856da;p=p5sagit%2Fp5-mst-13.2.git Initial cleanups to support compiling Win32 with MinGW g++. p4raw-id: //depot/perl@29155 --- diff --git a/perlio.c b/perlio.c index a5d4377..0b202de 100644 --- a/perlio.c +++ b/perlio.c @@ -3375,7 +3375,7 @@ PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt) FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio; if (ptr != NULL) { #ifdef STDIO_PTR_LVALUE - PerlSIO_set_ptr(stdio, (void*)ptr); /* LHS STDCHAR* cast non-portable */ + PerlSIO_set_ptr(stdio, ptr); /* LHS STDCHAR* cast non-portable */ #ifdef STDIO_PTR_LVAL_SETS_CNT if (PerlSIO_get_cnt(stdio) != (cnt)) { assert(PerlSIO_get_cnt(stdio) == (cnt)); diff --git a/win32/win32.c b/win32/win32.c index 49ba63a..be5e3f6 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -18,12 +18,6 @@ #ifndef HWND_MESSAGE # define HWND_MESSAGE ((HWND)-3) #endif -/* GCC-2.95.2/Mingw32-1.1 forgot the WINAPI on CommandLineToArgvW() */ -#if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION==1) -# include -#else - LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCommandLine, int * pNumArgs); -#endif #include #include #include @@ -38,6 +32,13 @@ #include "EXTERN.h" #include "perl.h" +/* GCC-2.95.2/Mingw32-1.1 forgot the WINAPI on CommandLineToArgvW() */ +#if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION==1) +# include +#else +EXTERN_C LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCommandLine, int * pNumArgs); +#endif + #define NO_XSLOCKS #define PERL_NO_GET_CONTEXT #include "XSUB.h" @@ -66,11 +67,13 @@ int _CRT_glob = 0; #if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION==1) /* Mingw32-1.1 is missing some prototypes */ +START_EXTERN_C FILE * _wfopen(LPCWSTR wszFileName, LPCWSTR wszMode); FILE * _wfdopen(int nFd, LPCWSTR wszMode); FILE * _freopen(LPCWSTR wszFileName, LPCWSTR wszMode, FILE * pOldStream); int _flushall(); int _fcloseall(); +END_EXTERN_C #endif #if defined(__BORLANDC__) @@ -4960,7 +4963,7 @@ Perl_sys_intern_init(pTHX) w32_num_pseudo_children = 0; # endif w32_timerid = 0; - w32_message_hwnd = INVALID_HANDLE_VALUE; + w32_message_hwnd = (HWND__*)INVALID_HANDLE_VALUE; w32_poll_count = 0; for (i=0; i < SIG_SIZE; i++) { w32_sighandler[i] = SIG_DFL;