From: <man...@us...> - 2013-06-30 14:41:51
|
Revision: 2445 http://sourceforge.net/p/modplug/code/2445 Author: manxorist Date: 2013-06-30 14:41:44 +0000 (Sun, 30 Jun 2013) Log Message: ----------- [Ref] Support building without zlib (useful mainly only for simple cross compile tests). Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/soundlib/load_j2b.cpp Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2013-06-30 14:10:14 UTC (rev 2444) +++ trunk/OpenMPT/common/BuildSettings.h 2013-06-30 14:41:44 UTC (rev 2445) @@ -107,6 +107,9 @@ // Define to build without FLAC support //#define NO_FLAC +// Define to build without zlib support +//#define NO_ZLIB + // Define to build without MP3 import support (via mpg123) //#define NO_MP3_SAMPLES @@ -144,6 +147,7 @@ #endif #define NO_DSOUND #define NO_FLAC +//#define NO_ZLIB #define NO_MP3_SAMPLES //#define NO_LIBMODPLUG #if !defined(_WIN32) || (defined(_WIN32) && !defined(_M_IX86)) Modified: trunk/OpenMPT/soundlib/load_j2b.cpp =================================================================== --- trunk/OpenMPT/soundlib/load_j2b.cpp 2013-06-30 14:10:14 UTC (rev 2444) +++ trunk/OpenMPT/soundlib/load_j2b.cpp 2013-06-30 14:41:44 UTC (rev 2445) @@ -14,6 +14,9 @@ #include "stdafx.h" #include "Loaders.h" #include "ChunkReader.h" + +#ifndef NO_ZLIB + #if MPT_COMPILER_MSVC #ifndef ZLIB_WINAPI #define ZLIB_WINAPI @@ -23,7 +26,9 @@ #include <zlib.h> #endif +#endif // ZLIB + // First off, a nice vibrato translation LUT. static const uint8 j2bAutoVibratoTrans[] = { @@ -978,6 +983,13 @@ bool CSoundFile::ReadJ2B(FileReader &file, ModLoadingFlags loadFlags) //------------------------------------------------------------------- { + +#ifdef NO_ZLIB + + return false; + +#else + file.Rewind(); J2BFileHeader fileHeader; if(!file.ReadConvertEndianness(fileHeader)) @@ -1024,4 +1036,7 @@ delete[] amFileData; return result; + +#endif + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |