develooper Front page | perl.perl5.porters | Postings from November 2003

Re: [PATCH] Re: MinGW-3.1.0-1 _CRTIMP definition preempting win32.h's

Thread Previous
From:
Jan Dubois
Date:
November 2, 2003 06:21
Subject:
Re: [PATCH] Re: MinGW-3.1.0-1 _CRTIMP definition preempting win32.h's
Message ID:
eb4aqvs3mfml6h7g2j3bc6ogaqm76i6kso@4ax.com
On Sun, 2 Nov 2003 15:09:54 +0100, Rafael Garcia-Suarez
<rgarciasuarez@free.fr> wrote:

>So a simple patch like this one should solve the problem. Does it look
>good ? (sorry, I can't test it, no MinGW here)


No MinGW here either, but you probably want something like this instead:

#if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION>=3)
#   undef _CRTIMP
#endif

#ifndef _CRTIMP
#   define _CRTIMP __declspec(dllimport)
#endif

to avoid a redefinition warning under MinGW.

Cheers,
-Jan


>Index: win32/win32.h
>===================================================================
>--- win32/win32.h	(revision 2678)
>+++ win32/win32.h	(working copy)
>@@ -465,7 +465,7 @@
> #ifdef PERL_CORE
> 
> /* C doesn't like repeat struct definitions */
>-#ifndef _CRTIMP
>+#if !defined(_CRTIMP) || (defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION>=3))
> #define _CRTIMP __declspec(dllimport)
> #endif
> 
>End of Patch.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About