This shuts up some compiler warnings on mingw but I don't know if my syntax is right. I know the rules about ifdef and ifndef but you guys said there was exceptions for the compilers so I figured I would check. Like I said I am still learning here so if this isnt right please flame away. Mingw32 currently lacks a good ./configure system as Msys wont see dlltool/wrap so I don't really have another option other then using my own makefiles for now. There is only about 4 or 5 other places I have found where mingw differs from normal GCC. Changelog: Fixes mingw32 warning about stdcall and fastcall being redefined. cvs diff winnt.h Index: winnt.h =================================================================== RCS file: /home/wine/wine/include/winnt.h,v retrieving revision 1.104 diff -u -r1.104 winnt.h --- winnt.h 2 Apr 2002 19:37:15 -0000 1.104 +++ winnt.h 4 Apr 2002 08:15:55 -0000 @@ -80,9 +80,11 @@ #ifndef __WINE__ #define pascal __stdcall #define _pascal __stdcall +#if ! defined(__WINE__) && !defined(__MINGW__) #define _stdcall __stdcall #define _fastcall __stdcall #define __fastcall __stdcall +#endif #define __export __stdcall #define cdecl __cdecl #define _cdecl __cdecl _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
"Steven Edwards" <Steven_Ed4153(a)yahoo.com> wrote:
diff -u -r1.104 winnt.h --- winnt.h 2 Apr 2002 19:37:15 -0000 1.104 +++ winnt.h 4 Apr 2002 08:15:55 -0000 @@ -80,9 +80,11 @@ #ifndef __WINE__ #define pascal __stdcall #define _pascal __stdcall +#if ! defined(__WINE__) && !defined(__MINGW__) #define _stdcall __stdcall #define _fastcall __stdcall #define __fastcall __stdcall +#endif #define __export __stdcall #define cdecl __cdecl #define _cdecl __cdecl
Why don't you use something like this: +#if !defined(_stdcall) #define _stdcall __stdcall #define _fastcall __stdcall #define __fastcall __stdcall +#endif -- Dmitry.
On Fri, 5 Apr 2002, Dmitry Timoshkov wrote:
"Steven Edwards" <Steven_Ed4153(a)yahoo.com> wrote:
diff -u -r1.104 winnt.h --- winnt.h 2 Apr 2002 19:37:15 -0000 1.104 +++ winnt.h 4 Apr 2002 08:15:55 -0000 @@ -80,9 +80,11 @@ #ifndef __WINE__ #define pascal __stdcall #define _pascal __stdcall +#if ! defined(__WINE__) && !defined(__MINGW__) #define _stdcall __stdcall #define _fastcall __stdcall #define __fastcall __stdcall +#endif #define __export __stdcall #define cdecl __cdecl #define _cdecl __cdecl
Why don't you use something like this:
+#if !defined(_stdcall) #define _stdcall __stdcall #define _fastcall __stdcall #define __fastcall __stdcall +#endif
Is _stdcall going to be a macro? I would rather expect it to be a reserved keyword like in Visual C++. Steven's patch looks good to me. -- Francois Gouget fgouget(a)free.fr http://fgouget.free.fr/ Advice is what we ask for when we already know the answer but wish we didn't -- Eric Jong
"Francois Gouget" <fgouget(a)free.fr> wrote:
+#if !defined(_stdcall) #define _stdcall __stdcall #define _fastcall __stdcall #define __fastcall __stdcall +#endif
Is _stdcall going to be a macro? I would rather expect it to be a reserved keyword like in Visual C++.
Certainly I don't know whether _stdcall is a macro or not, but the construction below compiles correctly without warnings by both cl and gcc. #if !defined(_stdcall) #define _stdcall __stdcall #endif #define WINAPI _stdcall typedef unsigned long DWORD; extern DWORD WINAPI GetLastError(void); int main(void) { return GetLastError() != 0xdeadbeef; } -- Dmitry.
participants (3)
-
Dmitry Timoshkov -
Francois Gouget -
Steven Edwards