diff options
author | Marti Maria <marti.maria@littlecms.com> | 2022-06-05 14:52:02 +0300 |
---|---|---|
committer | Marti Maria <marti.maria@littlecms.com> | 2022-06-05 14:52:02 +0300 |
commit | 6d235ed80a3e08a2cc36af29c16ea6e38a206f5a (patch) | |
tree | afe0aa8ae4c4d0c69f00121014b2c9d598b16a77 | |
parent | 7c3d51e21992f77516eb894f292c57ccc2526196 (diff) |
min macro is not portable
fix for min macro
-rw-r--r-- | plugins/threaded/src/threaded_split.c | 10 |
1 files changed, 8 insertions, 2 deletions
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)); |