diff --git a/juce_Config.h b/juce_Config.h index eb73ea2ce1..83fd150064 100644 --- a/juce_Config.h +++ b/juce_Config.h @@ -200,6 +200,14 @@ #define JUCE_INCLUDE_OGGVORBIS_CODE 1 #endif +#ifndef JUCE_INCLUDE_PNGLIB_CODE + #define JUCE_INCLUDE_PNGLIB_CODE 1 +#endif + +#ifndef JUCE_INCLUDE_JPEGLIB_CODE + #define JUCE_INCLUDE_JPEGLIB_CODE 1 +#endif + //============================================================================= /** Enable this to add extra memory-leak info to the new and delete operators. diff --git a/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp b/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp index e478bf5ba4..57eac0892f 100644 --- a/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp +++ b/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp @@ -37,6 +37,7 @@ namespace jpeglibNamespace { +#if JUCE_INCLUDE_JPEGLIB_CODE extern "C" { #define JPEG_INTERNALS @@ -112,6 +113,11 @@ namespace jpeglibNamespace #include "jpglib/jutils.c" #include "jpglib/transupp.c" } +#else + #define JPEG_INTERNALS + #undef FAR + #include +#endif } #if JUCE_MSVC diff --git a/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp b/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp index abcb22d57e..35a8381e70 100644 --- a/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp +++ b/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp @@ -38,15 +38,21 @@ namespace zlibNamespace { +#if JUCE_INCLUDE_ZLIB_CODE #undef OS_CODE #undef fdopen #include "../../../../../juce_core/io/streams/zlib/zlib.h" #undef OS_CODE +#else + #include +#endif } namespace pnglibNamespace { using namespace zlibNamespace; + +#if JUCE_INCLUDE_PNGLIB_CODE using ::malloc; using ::free; @@ -77,6 +83,13 @@ namespace pnglibNamespace #include "pnglib/pngwtran.c" #include "pnglib/pngwutil.c" } +#else + #define PNG_INTERNAL + #define PNG_SETJMP_NOT_SUPPORTED + + #include + #include +#endif } #ifdef _MSC_VER diff --git a/src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp b/src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp index e955fea7f6..84e9537ac1 100644 --- a/src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp +++ b/src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp @@ -33,10 +33,14 @@ namespace zlibNamespace { +#if JUCE_INCLUDE_ZLIB_CODE #undef OS_CODE #undef fdopen #include "zlib/zlib.h" #undef OS_CODE +#else + #include +#endif } BEGIN_JUCE_NAMESPACE