MSCMS: Use lcms only if both library and headers are detected

Jacek Caban jack at itma.pwr.wroc.pl
Sat Jul 16 11:20:37 CDT 2005


I have only 64-bit version of lcms so configure detects headers,
but fails to compile as it can't link to the library. This patch fixes
the problem.

Changelog:
    Use lcms only if both library and headers are detected
-------------- next part --------------
Index: dlls/mscms/handle.c
===================================================================
RCS file: /home/wine/wine/dlls/mscms/handle.c,v
retrieving revision 1.5
diff -u -p -r1.5 handle.c
--- dlls/mscms/handle.c	21 Feb 2005 18:38:15 -0000	1.5
+++ dlls/mscms/handle.c	16 Jul 2005 16:12:03 -0000
@@ -29,7 +29,7 @@
 
 #include "mscms_priv.h"
 
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
 
 static CRITICAL_SECTION MSCMS_handle_cs;
 static CRITICAL_SECTION_DEBUG MSCMS_handle_cs_debug =
@@ -284,4 +284,4 @@ void MSCMS_destroy_htransform_handle( HT
     }
 }
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
Index: dlls/mscms/icc.c
===================================================================
RCS file: /home/wine/wine/dlls/mscms/icc.c,v
retrieving revision 1.4
diff -u -p -r1.4 icc.c
--- dlls/mscms/icc.c	15 Jul 2005 10:09:43 -0000	1.4
+++ dlls/mscms/icc.c	16 Jul 2005 16:12:03 -0000
@@ -36,7 +36,7 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(mscms);
 
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
 
 static inline void MSCMS_adjust_endianess32( ULONG *ptr )
 {
@@ -107,4 +107,4 @@ DWORD MSCMS_get_profile_size( icProfile 
     return size;
 }
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
Index: dlls/mscms/mscms_priv.h
===================================================================
RCS file: /home/wine/wine/dlls/mscms/mscms_priv.h,v
retrieving revision 1.7
diff -u -p -r1.7 mscms_priv.h
--- dlls/mscms/mscms_priv.h	21 Feb 2005 18:38:15 -0000	1.7
+++ dlls/mscms/mscms_priv.h	16 Jul 2005 16:12:03 -0000
@@ -22,7 +22,11 @@
 #define HAVE_LCMS_H 1
 #endif
 
-#ifdef HAVE_LCMS_H
+#if defined(HAVE_LCMS_H) && defined(HAVE_LCMS)
+#define USE_LCMS
+#endif
+
+#ifdef USE_LCMS
 
 /*  These basic Windows types are defined in lcms.h when compiling on
  *  a non-Windows platform (why?), so they would normally not conflict
@@ -92,4 +96,4 @@ extern void MSCMS_get_profile_header( ic
 extern void MSCMS_set_profile_header( icProfile *iccprofile, PROFILEHEADER *header );
 extern DWORD MSCMS_get_profile_size( icProfile *iccprofile );
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
Index: dlls/mscms/profile.c
===================================================================
RCS file: /home/wine/wine/dlls/mscms/profile.c,v
retrieving revision 1.18
diff -u -p -r1.18 profile.c
--- dlls/mscms/profile.c	15 Jul 2005 10:09:43 -0000	1.18
+++ dlls/mscms/profile.c	16 Jul 2005 16:12:03 -0000
@@ -148,7 +148,7 @@ BOOL WINAPI GetColorProfileElement( HPRO
                                     PVOID buffer, PBOOL ref )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
     DWORD i, count;
     icTag tag;
@@ -177,7 +177,7 @@ BOOL WINAPI GetColorProfileElement( HPRO
         }
     }
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -202,7 +202,7 @@ BOOL WINAPI GetColorProfileElement( HPRO
 BOOL WINAPI GetColorProfileElementTag( HPROFILE profile, DWORD index, PTAGTYPE type )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
     DWORD count;
     icTag tag;
@@ -219,7 +219,7 @@ BOOL WINAPI GetColorProfileElementTag( H
 
     ret = TRUE;
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -244,7 +244,7 @@ BOOL WINAPI GetColorProfileElementTag( H
 BOOL WINAPI GetColorProfileFromHandle( HPROFILE profile, PBYTE buffer, PDWORD size )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
     PROFILEHEADER header;
 
@@ -265,7 +265,7 @@ BOOL WINAPI GetColorProfileFromHandle( H
     *size = header.phSize;
     ret = TRUE;
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -288,7 +288,7 @@ BOOL WINAPI GetColorProfileFromHandle( H
 BOOL WINAPI GetColorProfileHeader( HPROFILE profile, PPROFILEHEADER header )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
 
     TRACE( "( %p, %p )\n", profile, header );
@@ -298,7 +298,7 @@ BOOL WINAPI GetColorProfileHeader( HPROF
     MSCMS_get_profile_header( iccprofile, header );
     return TRUE;
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -319,7 +319,7 @@ BOOL WINAPI GetColorProfileHeader( HPROF
 BOOL WINAPI GetCountColorProfileElements( HPROFILE profile, PDWORD count )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
 
     TRACE( "( %p, %p )\n", profile, count );
@@ -328,7 +328,7 @@ BOOL WINAPI GetCountColorProfileElements
     *count = MSCMS_get_tag_count( iccprofile );
     ret = TRUE;
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -508,7 +508,7 @@ BOOL WINAPI InstallColorProfileW( PCWSTR
 BOOL WINAPI IsColorProfileTagPresent( HPROFILE profile, TAGTYPE type, PBOOL present )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
     DWORD i, count;
     icTag tag;
@@ -530,7 +530,7 @@ BOOL WINAPI IsColorProfileTagPresent( HP
         }
     }
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -551,7 +551,7 @@ BOOL WINAPI IsColorProfileTagPresent( HP
 BOOL WINAPI IsColorProfileValid( HPROFILE profile, PBOOL valid )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
 
     TRACE( "( %p, %p )\n", profile, valid );
@@ -559,7 +559,7 @@ BOOL WINAPI IsColorProfileValid( HPROFIL
     if (!valid) return FALSE;
     if (iccprofile) return *valid = TRUE;
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -584,7 +584,7 @@ BOOL WINAPI SetColorProfileElement( HPRO
                                     PVOID buffer )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
     DWORD i, count, access = MSCMS_hprofile2access( profile );
     icTag tag;
@@ -609,7 +609,7 @@ BOOL WINAPI SetColorProfileElement( HPRO
         }
     }
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -629,7 +629,7 @@ BOOL WINAPI SetColorProfileElement( HPRO
 BOOL WINAPI SetColorProfileHeader( HPROFILE profile, PPROFILEHEADER header )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
     DWORD access = MSCMS_hprofile2access( profile );
 
@@ -641,7 +641,7 @@ BOOL WINAPI SetColorProfileHeader( HPROF
     MSCMS_set_profile_header( iccprofile, header );
     return TRUE;
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -763,7 +763,7 @@ HPROFILE WINAPI OpenColorProfileA( PPROF
  */
 HPROFILE WINAPI OpenColorProfileW( PPROFILE profile, DWORD access, DWORD sharing, DWORD creation )
 {
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     cmsHPROFILE cmsprofile = NULL;
     icProfile *iccprofile = NULL;
     HANDLE handle = NULL;
@@ -831,7 +831,7 @@ HPROFILE WINAPI OpenColorProfileW( PPROF
     if (cmsprofile)
         return MSCMS_create_hprofile_handle( handle, iccprofile, cmsprofile, access );
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return NULL;
 }
 
@@ -850,7 +850,7 @@ HPROFILE WINAPI OpenColorProfileW( PPROF
 BOOL WINAPI CloseColorProfile( HPROFILE profile )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     icProfile *iccprofile = MSCMS_hprofile2iccprofile( profile );
     HANDLE file = MSCMS_hprofile2handle( profile );
     DWORD access = MSCMS_hprofile2access( profile );
@@ -872,6 +872,6 @@ BOOL WINAPI CloseColorProfile( HPROFILE 
     CloseHandle( MSCMS_hprofile2handle( profile ) );
     MSCMS_destroy_hprofile_handle( profile );
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
Index: dlls/mscms/transform.c
===================================================================
RCS file: /home/wine/wine/dlls/mscms/transform.c,v
retrieving revision 1.3
diff -u -p -r1.3 transform.c
--- dlls/mscms/transform.c	15 Jul 2005 10:09:43 -0000	1.3
+++ dlls/mscms/transform.c	16 Jul 2005 16:12:04 -0000
@@ -57,7 +57,7 @@ HTRANSFORM WINAPI CreateColorTransformW(
     HPROFILE target, DWORD flags )
 {
     HTRANSFORM ret = NULL;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     cmsHTRANSFORM cmstransform;
     cmsHPROFILE cmsprofiles[3];
     int intent;
@@ -84,7 +84,7 @@ HTRANSFORM WINAPI CreateColorTransformW(
     }
     ret = MSCMS_create_htransform_handle( cmstransform );
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -92,7 +92,7 @@ HTRANSFORM WINAPI CreateMultiProfileTran
     PDWORD intents, DWORD nintents, DWORD flags, DWORD cmm )
 {
     HTRANSFORM ret = NULL;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     cmsHPROFILE *cmsprofiles;
     cmsHTRANSFORM cmstransform;
     DWORD i;
@@ -115,14 +115,14 @@ HTRANSFORM WINAPI CreateMultiProfileTran
     HeapFree( GetProcessHeap(), 0, cmsprofiles );
     ret = MSCMS_create_htransform_handle( cmstransform );
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
 BOOL WINAPI DeleteColorTransform( HTRANSFORM transform )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     cmsHTRANSFORM cmstransform;
 
     TRACE( "( %p )\n", transform );
@@ -133,7 +133,7 @@ BOOL WINAPI DeleteColorTransform( HTRANS
     MSCMS_destroy_htransform_handle( transform );
     ret = TRUE;
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }
 
@@ -142,7 +142,7 @@ BOOL WINAPI TranslateBitmapBits( HTRANSF
     DWORD outputstride, PBMCALLBACKFN callback, ULONG data )
 {
     BOOL ret = FALSE;
-#ifdef HAVE_LCMS_H
+#ifdef USE_LCMS
     cmsHTRANSFORM cmstransform;
 
     TRACE( "( %p, %p, 0x%08x, 0x%08lx, 0x%08lx, 0x%08lx, %p, 0x%08x, 0x%08lx, %p, 0x%08lx )\n",
@@ -154,6 +154,6 @@ BOOL WINAPI TranslateBitmapBits( HTRANSF
     cmsDoTransform( cmstransform, srcbits, destbits, width * height );
     ret = TRUE;
 
-#endif /* HAVE_LCMS_H */
+#endif /* USE_LCMS */
     return ret;
 }


More information about the wine-patches mailing list