Technical support > Mac

HEAD (2.5) build failure on OSX 10.8/Clang and fix

(1/1)

Jon_dArc:
Building complains about two function calls in src/shared/images.cpp on account of no matching functions in jpeglib.h and no known conversion from bool to boolean; the offending argument is "true", and nearby similar functions use "TRUE" in the same position. Changing the two offending calls to "TRUE" satisfies the compiler; it looks like this might have been a typo (or brain-o) that might be concealed by an implicit conversion in other build environments. The relevant patch is included below:


--- Code: ---diff --git a/src/shared/images.cpp b/src/shared/images.cpp
index d11e250..b8f9868 100644
--- a/src/shared/images.cpp
+++ b/src/shared/images.cpp
@@ -247,7 +247,7 @@ void R_WriteJPG (qFILE *f, byte *buffer, int width, int heig
 
        jpeg_set_defaults(&cinfo);
        jpeg_set_quality(&cinfo, quality, TRUE);
-       jpeg_start_compress(&cinfo, true);      /* start compression */
+       jpeg_start_compress(&cinfo, TRUE);      /* start compression */
        jpeg_write_marker(&cinfo, JPEG_COM, (const byte *) "UFOAI", (uint32_t) 5
 
        /* Feed scanline data */
@@ -397,7 +397,7 @@ static SDL_Surface* Img_LoadJPG(char const* const name)
                jpeg_mem_src(&cinfo, buf, len);
 #endif
 
-               jpeg_read_header(&cinfo, true);
+               jpeg_read_header(&cinfo, TRUE);
 
                cinfo.out_color_space = JCS_RGB;
--- End code ---

~J

Mattn:
thanks a lot. applied to master

Jon_dArc:
You missed the second occurrence (not hard, the code block hides it and gives no indication there's anything to scroll to).


--- Code: ---diff --git a/src/shared/images.cpp b/src/shared/images.cpp
index 4ed93d3..b8f9868 100644
--- a/src/shared/images.cpp
+++ b/src/shared/images.cpp
@@ -397,7 +397,7 @@ static SDL_Surface* Img_LoadJPG(char const* const name)
                jpeg_mem_src(&cinfo, buf, len);
 #endif
 
-               jpeg_read_header(&cinfo, true);
+               jpeg_read_header(&cinfo, TRUE);
 
                cinfo.out_color_space = JCS_RGB;
--- End code ---

~J

Mattn:
applied to master, too. sorry and thanks again

Navigation

[0] Message Index

Go to full version