From 6d235ed80a3e08a2cc36af29c16ea6e38a206f5a Mon Sep 17 00:00:00 2001 From: Marti Maria Date: Sun, 5 Jun 2022 13:52:02 +0200 Subject: min macro is not portable fix for min macro --- plugins/threaded/src/threaded_split.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/threaded/src/threaded_split.c b/plugins/threaded/src/threaded_split.c index 26a2ce2..06dfea7 100644 --- a/plugins/threaded/src/threaded_split.c +++ b/plugins/threaded/src/threaded_split.c @@ -44,6 +44,12 @@ cmsINLINE cmsUInt32Number PixelSpacing(cmsUInt32Number format) return ComponentSize(format) * (T_CHANNELS(format) + T_EXTRA(format)); } +// macro is not portable +cmsINLINE cmsUInt32Number minimum(cmsUInt32Number a, cmsUInt32Number b) +{ + return a < b ? a : b; +} + // Memory of block depends of planar or chunky. If lines is 1, then the stride does not contain // information and we have to calculate the size. If lines > 1, then we can take line size from stride. @@ -129,7 +135,7 @@ void SlicePerLines(const _cmsWorkSlice* master, cmsInt32Number nslices, const cmsUInt8Number* PtrInput = master->InputBuffer; cmsUInt8Number* PtrOutput = master->OutputBuffer; - cmsInt32Number lines = min(LinesPerSlice, TotalLines); + cmsInt32Number lines = minimum(LinesPerSlice, TotalLines); memcpy(&slices[i], master, sizeof(_cmsWorkSlice)); @@ -157,7 +163,7 @@ void SlicePerPixels(const _cmsWorkSlice* master, cmsInt32Number nslices, const cmsUInt8Number* PtrInput = master->InputBuffer; cmsUInt8Number* PtrOutput = master->OutputBuffer; - cmsInt32Number pixels = min(PixelsPerSlice, TotalPixels); + cmsInt32Number pixels = minimum(PixelsPerSlice, TotalPixels); memcpy(&slices[i], master, sizeof(_cmsWorkSlice)); -- cgit v1.2.3