This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: WINAPI definition


Thomas Nichols[SMTP:thomas.nichols@mail.com] wrote:
>to compile, and the following line breaks:
>
>	static BOOL (WINAPI *Ctl3dRegister)(HINSTANCE);
>
>>From looking at preprocessor output, WINAPI is getting expanded to
>__attribute__ ((stdcall))
>
>and cc1plus.exe doesn't like this at all.

cc1plus has a bug/feature in the parsing code such that attributes
cannot appear in the same places they can in cc1. I think you might
be able to put the WINAPI (or attribute) at the end of the
declaration to get the same effect, but I'm not sure.

Colin.

PS. It's an interesting question to me whether this works
    right anyway. Assuming the GNU guys were smart (and
    they often are) the stdcall attribute can be attached
    to function pointers this way and when you call a
    function through the pointer the proper PASCAL type
    calling process will be followed. It does strike me
    as the kind of thing that could get forgotten though...


-- Colin Peters - Saga Univ. Dept. of Information Science
-- colin@bird.fu.is.saga-u.ac.jp - finger for PGP public key
-- http://www.fu.is.saga-u.ac.jp/~colin/index.html
-- http://www.geocities.com/Tokyo/Towers/6162/

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]