Skip to content

Commit

Permalink
More fixes from Artifex
Browse files Browse the repository at this point in the history
More fixes from Artifex
Thank you!
  • Loading branch information
mm2 committed May 26, 2020
1 parent d881cc6 commit 2021357
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/cmsplugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ cmsBool CMSEXPORT _cmsReadFloat32Number(cmsIOHANDLER* io, cmsFloat32Number* n)
return TRUE;
#elif defined (__BORLANDC__)
return TRUE;
#elif !defined(_MSC_VER) && (defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L)
return TRUE;
#else

// fpclassify() required by C99 (only provided by MSVC >= 1800, VS2013 onwards)
Expand Down
8 changes: 4 additions & 4 deletions src/cmsps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,14 @@ void EmitLab2XYZ(cmsIOHANDLER* m)
}

static
void EmitSafeGuardBegin(cmsIOHANDLER* m, char* name)
void EmitSafeGuardBegin(cmsIOHANDLER* m, const char* name)
{
_cmsIOPrintf(m, "%%LCMS2: Save previous definition of %s on the operand stack\n", name);
_cmsIOPrintf(m, "currentdict /%s known { /%s load } { null } ifelse\n", name, name);
}

static
void EmitSafeGuardEnd(cmsIOHANDLER* m, char* name, int depth)
void EmitSafeGuardEnd(cmsIOHANDLER* m, const char* name, int depth)
{
_cmsIOPrintf(m, "%%LCMS2: Restore previous definition of %s\n", name);
if (depth > 1) {
Expand All @@ -452,7 +452,7 @@ void EmitSafeGuardEnd(cmsIOHANDLER* m, char* name, int depth)
// Outputs a table of words. It does use 16 bits

static
void Emit1Gamma(cmsIOHANDLER* m, cmsToneCurve* Table, char* name)
void Emit1Gamma(cmsIOHANDLER* m, cmsToneCurve* Table, const char* name)
{
cmsUInt32Number i;
cmsFloat64Number gamma;
Expand Down Expand Up @@ -538,7 +538,7 @@ cmsBool GammaTableEquals(cmsUInt16Number* g1, cmsUInt16Number* g2, cmsUInt32Numb
// Does write a set of gamma curves

static
void EmitNGamma(cmsIOHANDLER* m, cmsUInt32Number n, cmsToneCurve* g[], char* nameprefix)
void EmitNGamma(cmsIOHANDLER* m, cmsUInt32Number n, cmsToneCurve* g[], const char* nameprefix)
{
cmsUInt32Number i;
static char buffer[2048];
Expand Down
7 changes: 7 additions & 0 deletions src/lcms2_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@
#define isinf(x) (!_finite((x)))
# endif

#if !defined(_MSC_VER) && (defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L)
#if !defined(isinf)
#define isinf(x) (!finite((x)))
#endif
#endif


#endif

// A fast way to convert from/to 16 <-> 8 bits
Expand Down

0 comments on commit 2021357

Please sign in to comment.