RE: SV: [xml] windows binary with different calling



  Hum, so this is a pain for at least one real long time user...
Damn, maybe I may do it finally ... I assume you have patches handy,
how are the changes done (i.e. can you provide a small example for
one declaration) ?

Well we don't need to do anything on my behalf.  I'm perfectly content
with the way things are now and wouldn't benefit from this myself as my
problem is now with the other libraries I link to that are stdcall.

If we want to fix this for others with similar problems there are really
three options to implement as Igor has mentioned already and take one of
the three forms depending on whether you want to remove the .def related
stuff or not

/* XMLAPI evalutes to the calling convention, __cdecl or __stdcall on
win32 */
returntype XMLAPI function();

or

/* XMLAPI evalutates as above, XMLEXPORT evaluates __declspec(dllexport)
or __declspec(dllimport) depending on whether you are building the
library or linking against it */
XMLEXPORT returnType XMLAPI function();

or possibly

/* XMLEXPORT evaluates to
   #define XMLEXPORT(a) __declspec(dll(im|ex)port) a __cdecl
*/
XMLEXPORT(returnType) function();

Whichever method is preferred and less invasive.  Again this doesn't
need to be done for my sake but is arguably the "correct thing" to do
for win32 libraries.

mark



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]