| Summary: | [PATCH] Compilation error with "IMG_jpg.c" on Mac OS X | ||
|---|---|---|---|
| Product: | SDL_image | Reporter: | Holger Schemel <sdl-bugzilla> |
| Component: | misc | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.1 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X 10.11 | ||
| Attachments: | patch | ||
Fixed, thanks! https://hg.libsdl.org/SDL_image/rev/90b2de23ea5e This is now fixed. |
Created attachment 2948 [details] patch Summary: Error when compiling file "IMG_jpg.c" on Mac OS X. This compilation error may possibly only occur in certain cases (maybe depending on what "./configure" detected); however, it will always occur if the first "#if" (at the very top of the file) results in the corresponding #if/#endif block to be skipped. In this case, the remaining part of the source file (starting with "#define SAVE_JPG" / "#ifdef SAVE_JPG") will always be compiled, but has no SDL stuff defined (like "SDL_Surface" etc.), because "SDL_image.h" was never included in this case, and will therefore fail with a compiler error. The attached patch simply moves that first "#if" below the "#include"s, which fixes the problem.