2004.09.14 11:06 "[Tiff] Calltype support", by Martin Schramm

2004.09.15 15:38 "Re: [Tiff] Calltype support", by Bob Friesenhahn

But we do maintain a libtiff.def already to keep the list of functions to be exported. The issue in question is calling conventions which is in addition to the issue of controlling what gets exported.

The libtiff.def approach is easier for the library maintainer but it is invasive for the library user. DLL exported functions should be __declspec(dllimport) by default so that library users don't need to know if they are using a DLL. This can be accomplished with appropriately "decorated" header files.

I have used macros like your TIFFEXPORT (which presumably evaluates to __declspec(dllexport) on win32) before, but I don't know that it is sufficient to handle calling convention issues. It seems to me I have run into issues with where the __cdecl parameter goes in the declaration of a function and it wasn't always sufficient to just put it in where the __declspec(dllexport) would go, and that for this reason a more complex function macro mechanism was required.

I don't have the expertise to answer that. We have not had to do anything more than __declspec(dllimport)/__declspec(dllexport) for the GraphicsMagick libraries. To invoke the Ghostscript DLL functions there was some use of stdcall.


Bob Friesenhahn