[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-patches
Subject:    Microsoft Visual C (MSVC) compabillity
From:       Patrik Stridvall <ps () leissner ! se>
Date:       2002-01-31 20:38:20
[Download RAW message or body]

It seems that you are right.

void (WINAPI *foo)(void);

works fine with gcc. 

Hmm, must done something wrong then I tested it
some year ago.

All of the forms:

(1) void WINAPI (*foo)(void);
(2) void (* WINAPI foo)(void);
(3) void (WINAPI *foo)(void);

Seems to work with gcc. Even with gcc 2.7.x.

However only form (3) works with Microsoft Visual C.

So here is a patch that changes (1) and (2) to (3).
It is not everything, far from it, but its a start.

Will be back with the rest if you apply this patch.

---8<---

*** msvc

* include/callback.h,
  include/commctrl.h,
  include/commdlg.h,
  include/d3dcaps.h,
  include/d3dhal.h,
  include/d3dtypes.h,
  include/ddeml.h,
  include/ddraw.h,
  include/ddrawi.h,
  include/dinput.h,
  include/dplay.h,
  include/dplobby.h,
  include/dsound.h,
  include/imagehlp.h,
  include/imm.h,
  include/miscemu.h,
  include/mmsystem.h,
  include/msacm.h,
  include/netspi.h,
  include/ole.h,
  include/ole2.h,
  include/oledlg.h,
  include/prsht.h,
  include/richedit.h,
  include/setupapi.h,
  include/shlobj.h,
  include/shlwapi.h,
  include/tapi.h,
  include/task.h,
  include/vfw.h,
  include/winbase.h,
  include/windef.h,
  include/wine/exception.h,
  include/wine/mmsystem16.h,
  include/wine/obj_base.h,
  include/wine/obj_oleaut.h,
  include/wine/obj_oleview.h,
  include/wine/windef16.h,
  include/wine/wingdi16.h,
  include/wine/winuser16.h,
  include/wingdi.h,
  include/wininet.h,
  include/winnetwk.h,
  include/winnls.h,
  include/winnt.h,
  include/winsock2.h,
  include/winsvc.h,
  include/winuser.h,
  include/ws2spi.h:
Move __stdcall/__cdecl to the right place.

*** msvc2

* tools/winebuild/spec16.c:
Move __stdcall/__cdecl to the right place.


["msvc.diff.gz" (application/octet-stream)]
["msvc2.diff" (application/octet-stream)]

Index: wine/tools/winebuild/spec16.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/spec16.c,v
retrieving revision 1.24
diff -u -u -r1.24 spec16.c
--- wine/tools/winebuild/spec16.c	2001/12/14 23:14:26	1.24
+++ wine/tools/winebuild/spec16.c	2002/01/31 18:27:30
@@ -353,7 +353,7 @@
 
     ret_type = reg_func? "void" : short_ret ? "unsigned short" : "unsigned int";
 
-    fprintf( outfile, "typedef %s __stdcall (*proc_%s_t)( ", ret_type, profile );
+    fprintf( outfile, "typedef %s (__stdcall *proc_%s_t)( ", ret_type, profile );
     args = profile + 7;
     for ( i = 0; args[i]; i++ )
     {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic