[PATCH] [PUSHED] Windows lcms2 library import fix

Tor Lillqvist tml at iki.fi
Mon Mar 19 00:58:09 PDT 2012

>  there is a link error in writerperfect's cdrimport, caused by libcdr/lcms2
> libraries. So as far as I understand it, on Windows a library uses dllexport
> when it is being built and dllimport when something else is built against it.

Actually, when importing, the dllimport attribute is optional (for
functions, not for data); it only makes the run-time linkage a bit

The problem here was (as far as I could see) that the stdcall
attribute wasn't used either unless CMS_DLL was defined.

"stdcall" is a calling convention that despite its name is *not* the
"standard" one for C code on (32-bit) Windows. That is "cdecl".
"stdcall" is a historical artefact still used by the core Windows API
itself, and by 3rd-party coders that seem to live in the past. (Yeah,
personal opinion, not "fact".)

(In 64-bit Windows much of the historical baggage has been cleaned out
and there is just one calling convention.)

Pushed your patch, with a clarification of the comment.


More information about the LibreOffice mailing list