[EMAIL PROTECTED] wrote on 15.04.2008 14:40:15:
> [EMAIL PROTECTED] wrote on 15.04.2008 14:28:17:
>
> > I'm not exactly sure how this one was introduced, but a bootstrap on
> > native i686-pc-mingw32 dies in stage1 libgcc with:
> >
> > ../../../trunk/libgcc/../gcc/libgcc2.c:2052: warning: no previous
> > prototype for 'getpagesize'
> > ../../../trunk/libgcc/../gcc/libgcc2.c:2062: error: conflicting types
> > for 'VirtualProtect'
> > c:/MinGW/include/winbase.h:1995: error: previous declaration of
> > 'VirtualProtect' was here
> > ../../../trunk/libgcc/../gcc/libgcc2.c:2066: warning: no previous
> > prototype for 'mprotect'
> >
> > The prototype for VirtualProtect in libgcc2.c is:
> > extern int VirtualProtect (char *, int, int, int *)
> > __attribute__((stdcall));
> >
> > In <winbase.h>, it is:
> > BOOL __attribute__((__stdcall__))
> VirtualProtect(PVOID,DWORD,DWORD,PDWORD);
> > with:
> > typedef unsigned long DWORD;
> > typedef int WINBOOL;
> > typedef WINBOOL BOOL;
> > typedef DWORD *PDWORD;
> > typedef void *PVOID;
> >
> >
> > Does that ring a bell to anyone? Any idea why it's showing up now even
> > though it looks like this code wasn't modified in the recent past (and
> > my winbase.h hasn't changed since my last successful bootstrap, a
> > month ago).
Here is a patch fixing this problem
2008-04-15 Kai Tietz <[EMAIL PROTECTED]>
* libgcc2.c (L_trampoline): Disable VirtualProtect declaration
if _WIN32 is defined.
Cheers,
Kai
Index: gcc/gcc/libgcc2.c
===================================================================
--- gcc.orig/gcc/libgcc2.c
+++ gcc/gcc/libgcc2.c
@@ -2058,7 +2058,7 @@ getpagesize (void)
#endif
}
-#ifdef __i386__
+#if defined(__i386__) && !defined(_WIN32)
extern int VirtualProtect (char *, int, int, int *) __attribute__((stdcall));
#endif
=