summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <info@littlecms.com>2015-03-17 12:19:51 +0100
committerMarti Maria <info@littlecms.com>2015-03-17 12:19:51 +0100
commitf20b84fe595cfe27b8b10e84248d8c94e26f8d20 (patch)
treed5aca4647c4b2012c155712b0d9c303e621657a4
parent82496d221436574fed6b77dc3a07123b697f2edd (diff)
downloadlcms2-f20b84fe595cfe27b8b10e84248d8c94e26f8d20.tar.gz
Added a version retrieval functionlcms2.7rc3lcms2-2.7
-rw-r--r--ChangeLog1
-rwxr-xr-xdoc/LittleCMS2.7 API.pdfbin1064667 -> 1005579 bytes
-rwxr-xr-xdoc/src.zipbin2448289 -> 2454530 bytes
-rw-r--r--include/lcms2.h6
-rw-r--r--src/cmserr.c9
-rw-r--r--src/lcms2.def1
-rw-r--r--testbed/testcms2.c7
7 files changed, 21 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b36e5ac..dd0b3c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -159,6 +159,7 @@ Added license for iccjpeg.c
Added a project for VS2013
Fixed wrong handling of extra channels in some formatters.
Added an option in transicc for working in bounded mode
+Added a version retrieval function
-----------------------
2.7 Maintenance release
diff --git a/doc/LittleCMS2.7 API.pdf b/doc/LittleCMS2.7 API.pdf
index 930eb7f..611ee8b 100755
--- a/doc/LittleCMS2.7 API.pdf
+++ b/doc/LittleCMS2.7 API.pdf
Binary files differ
diff --git a/doc/src.zip b/doc/src.zip
index 129726e..13f3aeb 100755
--- a/doc/src.zip
+++ b/doc/src.zip
Binary files differ
diff --git a/include/lcms2.h b/include/lcms2.h
index e5080e7..a0421d8 100644
--- a/include/lcms2.h
+++ b/include/lcms2.h
@@ -23,7 +23,7 @@
//
//---------------------------------------------------------------------------------
//
-// Version 2.7rc2
+// Version 2.7
//
#ifndef _lcms2_H
@@ -1001,6 +1001,10 @@ typedef struct {
} cmsICCViewingConditions;
+// Get LittleCMS version (for shared objects) -----------------------------------------------------------------------------
+
+CMSAPI int CMSEXPORT cmsGetEncodedCMMversion(void);
+
// Support of non-standard functions --------------------------------------------------------------------------------------
CMSAPI int CMSEXPORT cmsstrcasecmp(const char* s1, const char* s2);
diff --git a/src/cmserr.c b/src/cmserr.c
index 29516db..512ae07 100644
--- a/src/cmserr.c
+++ b/src/cmserr.c
@@ -1,7 +1,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2012 Marti Maria Saguer
+// Copyright (c) 1998-2015 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -25,6 +25,13 @@
#include "lcms2_internal.h"
+
+// This function is here to help applications to prevent mixing lcms versions on header and shared objects.
+int CMSEXPORT cmsGetEncodedCMMversion(void)
+{
+ return LCMS_VERSION;
+}
+
// I am so tired about incompatibilities on those functions that here are some replacements
// that hopefully would be fully portable.
diff --git a/src/lcms2.def b/src/lcms2.def
index a6fb54d..c5e8603 100644
--- a/src/lcms2.def
+++ b/src/lcms2.def
@@ -340,3 +340,4 @@ _cmsDestroyMutex = _cmsDestroyMutex
_cmsLockMutex = _cmsLockMutex
_cmsUnlockMutex = _cmsUnlockMutex
cmsGetProfileIOhandler = cmsGetProfileIOhandler
+cmsGetEncodedCMMversion = cmsGetEncodedCMMversion
diff --git a/testbed/testcms2.c b/testbed/testcms2.c
index 5584f6e..1469fb3 100644
--- a/testbed/testcms2.c
+++ b/testbed/testcms2.c
@@ -8165,7 +8165,6 @@ void PrintSupportedIntents(void)
int main(int argc, char* argv[])
{
-
cmsInt32Number Exhaustive = 0;
cmsInt32Number DoSpeedTests = 1;
cmsInt32Number DoCheckTests = 1;
@@ -8176,6 +8175,11 @@ int main(int argc, char* argv[])
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
+ // First of all, check for the right header
+ if (cmsGetEncodedCMMversion() != LCMS_VERSION) {
+ Die("Oops, you are mixing header and shared lib!\nHeader version reports to be '%d' and shared lib '%d'\n", LCMS_VERSION, cmsGetEncodedCMMversion());
+ }
+
printf("LittleCMS %2.2f test bed %s %s\n\n", LCMS_VERSION / 1000.0, __DATE__, __TIME__);
if ((argc == 2) && strcmp(argv[1], "--exhaustive") == 0) {
@@ -8190,6 +8194,7 @@ int main(int argc, char* argv[])
printf("done.\n");
#endif
+
printf("Installing debug memory plug-in ... ");
cmsPlugin(&DebugMemHandler);
printf("done.\n");