# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- HEAD
+++ Modified In Working Tree
@@ -19,13 +19,13 @@
 
 #include <glib.h>  /* lcms.h uses the "inline" keyword */
 
-#ifdef G_OS_WIN32
-#define STRICT
+//#ifdef G_OS_WIN32
+//#define STRICT
 #include <windows.h>
-#define LCMS_WIN_TYPES_ALREADY_DEFINED
-#endif
+//#define LCMS_WIN_TYPES_ALREADY_DEFINED
+//#endif
 
-#include <lcms.h>
+#include <lcms2.h>
 
 #include <gtk/gtk.h>
 
@@ -35,6 +35,7 @@
 #include <CoreServices/CoreServices.h>
 #endif
 
+#include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpconfig/gimpconfig.h"
 #include "libgimpmath/gimpmath.h"
@@ -134,7 +135,7 @@
   display_class->convert_surface = cdisplay_lcms_convert_surface;
   display_class->changed         = cdisplay_lcms_changed;
 
-  cmsErrorAction (LCMS_ERROR_IGNORE);
+//  cmsErrorAction (LCMS_ERROR_IGNORE);
 }
 
 static void
@@ -167,17 +168,52 @@
                                 const gchar **name,
                                 const gchar **info)
 {
+  cmsUInt32Number     descSize =0;
+  gchar             *descData;
+
   if (profile)
     {
-      *name = cmsTakeProductDesc (profile);
+      descSize = cmsGetProfileInfoASCII(profile, cmsInfoDescription, "en", "US", NULL, 0);
+      if (descSize > 0)
+        {
+          descData = (gchar*) g_malloc(descSize + sizeof(gchar));
+          descSize = cmsGetProfileInfoASCII(profile, cmsInfoDescription, "en", "US", descData, descSize);
+          if (descSize > 0)
+            {
+              *name = gimp_any_to_utf8 ((gchar*)descData, -1, NULL);
+            }
+        }
+//      *name = cmsTakeProductDesc (profile);
 
       if (! *name)
-        *name = cmsTakeProductName (profile);
+        {
+          descSize = cmsGetProfileInfoASCII(profile, cmsInfoModel, "en", "US", NULL, 0);
+          if (descSize > 0)
+            {
+              descData = (gchar*) g_malloc(descSize + sizeof(gchar));
+              descSize = cmsGetProfileInfoASCII(profile, cmsInfoModel, "en", "US", descData, descSize);
+              if (descSize > 0)
+                {
+                  name = descData;
+                }
+            }
+//        *name = cmsTakeProductName (profile);
+        }
 
       if (*name && ! g_utf8_validate (*name, -1, NULL))
         *name = _("(invalid UTF-8 string)");
 
-      *info = cmsTakeProductInfo (profile);
+      descSize = cmsGetProfileInfoASCII(profile, cmsInfoManufacturer, "en", "US", NULL, 0);
+      if (descSize > 0)
+        {
+          descData = (gchar*) g_malloc(descSize + sizeof(gchar));
+          descSize = cmsGetProfileInfoASCII(profile, cmsInfoManufacturer, "en", "US", descData, descSize);
+          if (descSize > 0)
+            {
+              *info = descData;
+            }
+        }
+//      *info = cmsTakeProductInfo (profile);
       if (*name && ! g_utf8_validate (*info, -1, NULL))
         *info = NULL;
     }
@@ -313,7 +349,8 @@
   cmsHPROFILE      src_profile   = NULL;
   cmsHPROFILE      dest_profile  = NULL;
   cmsHPROFILE      proof_profile = NULL;
-  DWORD            flags         = 0;
+  cmsUInt32Number     flags    = 0;
+  cmsUInt16Number alarmCodes[cmsMAXCHANNELS] = { 0 };
 
   if (lcms->transform)
     {
@@ -363,7 +400,12 @@
 
           gimp_rgb_get_uchar (&config->out_of_gamut_color, &r, &g, &b);
 
-          cmsSetAlarmCodes (r, g, b);
+          alarmCodes[0] = (cmsUInt16Number)r;
+          alarmCodes[1] = (cmsUInt16Number)g;
+          alarmCodes[2] = (cmsUInt16Number)b;
+          cmsSetAlarmCodes(alarmCodes);
+
+//          cmsSetAlarmCodes (r, g, b);
         }
 
       lcms->transform = cmsCreateProofingTransform (src_profile, TYPE_ARGB_8,
@@ -398,7 +440,7 @@
 static gboolean
 cdisplay_lcms_profile_is_rgb (cmsHPROFILE profile)
 {
-  return (cmsGetColorSpace (profile) == icSigRgbData);
+  return (cmsGetColorSpace (profile) == cmsSigRgbData);
 }
 
 static cmsHPROFILE
