Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



 Hello,

 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. 
Our libraries achieve this by detecting they're being built and doing 
dllexport, otherwise dllimport. This is not the case with lcms2, which uses 
dllexport if CMS_DLL_BUILD is defined (which is done in its project file), 
and uses dllimport, if CMS_DLL is defined, which is not done anywhere (I 
assume the expectation is that anything that touches lcms2 even with a 
ten-foot pole does this define). Is the attached patch a good way to solve 
the problem as well? I don't know what the usual idiom of handling this is, 
so I'd like somebody to check.

-- 
 Lubos Lunak
 l.lunak@suse.cz
diff --git a/lcms2/lcms2-windows-export.patch b/lcms2/lcms2-windows-export.patch
new file mode 100644
index 0000000..26462ad
--- /dev/null
+++ b/lcms2/lcms2-windows-export.patch
@@ -0,0 +1,17 @@
+--- misc/build/lcms2-2.3/include/lcms2.h.sav   2011-12-15 16:45:47.000000000 +0100
++++ misc/build/lcms2-2.3/include/lcms2.h       2012-03-17 22:53:28.731585981 +0100
+@@ -192,6 +192,14 @@ typedef int                  cmsBool;
+ # endif
+ #endif
+ 
++// LibreOffice always builds this as DLL, so make this usable from outside
++// without having to specify CMS_DLL manually whenever the library is used.
++#ifndef CMS_DLL_BUILD
++#ifndef CMS_DLL
++#define CMS_DLL
++#endif
++#endif
++
+ // Calling convention -- this is hardly platform and compiler dependent
+ #ifdef CMS_IS_WINDOWS_
+ #  if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
diff --git a/lcms2/makefile.mk b/lcms2/makefile.mk
index 0c7f5d5..2be34b5 100644
--- a/lcms2/makefile.mk
+++ b/lcms2/makefile.mk
@@ -39,7 +39,7 @@ TARGET=so_lcms2
 TARFILE_NAME=lcms2-2.3
 TARFILE_MD5=327348d67c979c88c2dec59a23a17d85
 
-PATCH_FILES = lcms2.patch
+PATCH_FILES = lcms2.patch lcms2-windows-export.patch
 
 .IF "$(SYSTEM_LCMS2)" == "YES"
 @all:

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.