I built skia (m127) on QNX, and ran into errors in the jpeg code. There are several places that use C++ true/false as values to libjpeg's boolean. That is clearly wrong, as these are two separate types. libjpeg (both vanilla and turbo) define TRUE and FALSE for that.
A quick search of this group shows a couple of related failures on macOS.
Fixes are trivial:
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index a74ac9c140..83e16ddfcb 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -102,7 +102,7 @@ SkCodec::Result SkJpegCodec::ReadHeader(
}
// Read the jpeg header
- switch (jpeg_read_header(dinfo, true)) {
+ switch (jpeg_read_header(dinfo, TRUE)) {
case JPEG_HEADER_OK:
break;
case JPEG_SUSPENDED:
diff --git a/src/codec/SkJpegUtility.cpp b/src/codec/SkJpegUtility.cpp
index 99dee251a0..01cb2c6a0f 100644
--- a/src/codec/SkJpegUtility.cpp
+++ b/src/codec/SkJpegUtility.cpp
@@ -56,12 +56,12 @@ static boolean sk_fill_buffered_input_buffer(j_decompress_ptr dinfo) {
// Let libjpeg know that the buffer needs to be refilled
src->next_input_byte = nullptr;
src->bytes_in_buffer = 0;
- return false;
+ return FALSE;
}
src->next_input_byte = (const JOCTET*) src->fBuffer;
src->bytes_in_buffer = bytes;
- return true;
+ return TRUE;
}
/*
@@ -124,7 +124,7 @@ static boolean sk_fill_mem_input_buffer (j_decompress_ptr cinfo) {
* buffer, so any request for more data beyond the given buffer size
* is treated as an error.
*/
- return false;
+ return FALSE;
}
/*
(Apologies for any formatting errors, this is the first time I've used this interface)
--Elad