[xml] windows binary with different calling conventions
- From: Gustaf Räntilä <opera home se>
- To: <xml gnome org>
- Subject: [xml] windows binary with different calling conventions
- Date: Sun, 1 Jun 2003 22:30:04 +0200
Hi again Igor,
Just to tell ya, it became two beers that other night :-)
The major problem I had with linking was that I was using stdcall and
the lib uses cdecl. What's irritating is that there's no problem merging
any call with another. As long as you specifically type _cdecl in a
stdcall-program that function will be treated as cdecl. So you can use
different calls for different functions.
If you added a macro definition CDECL that is empty declared except for
in WIN32 where it's declared to _cdecl, and added CDECL before every
call to the library, then anyone could use the library, whatever calling
convention they use in the rest of their application. What about that
idea?
I know that you'll have a dozen of reasons why this is bad, why you
don't like that "type of solution", but I'm just curious to here what
they are ;-)
I had three link errors when I used stdcall (since I used three calls to
the lib). Switching the entire app to cdecl it work perfectly. Switching
back to stdcall but adding _cdecl to one of your declarations in one of
your .h-files, decreased it to 2 link errors. I guess I could add _cdecl
to every of your functions and every would work.
/Gustaf
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]