From 705ad16d93d1d6d1beccad67825fd6e0049228c0 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 28 Apr 2019 03:31:26 +0800 Subject: [PATCH] VS2008 can't compile dr_mp3.h --- code/nel/include/nel/sound/audio_decoder_mp3.h | 4 ++++ code/nel/src/sound/audio_decoder.cpp | 2 ++ code/nel/src/sound/audio_decoder_mp3.cpp | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/code/nel/include/nel/sound/audio_decoder_mp3.h b/code/nel/include/nel/sound/audio_decoder_mp3.h index fac2e2693..e6ef91326 100644 --- a/code/nel/include/nel/sound/audio_decoder_mp3.h +++ b/code/nel/include/nel/sound/audio_decoder_mp3.h @@ -18,6 +18,8 @@ #define NLSOUND_AUDIO_DECODER_MP3_H #include +#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ + #include // disable drmp3_init_file() @@ -91,6 +93,8 @@ public: } /* namespace NLSOUND */ +#endif /* (NL_COMP_VC_VERSION > 90) */ + #endif // NLSOUND_AUDIO_DECODER_MP3_H /* end of file */ diff --git a/code/nel/src/sound/audio_decoder.cpp b/code/nel/src/sound/audio_decoder.cpp index d849ed770..506c01a3b 100644 --- a/code/nel/src/sound/audio_decoder.cpp +++ b/code/nel/src/sound/audio_decoder.cpp @@ -103,10 +103,12 @@ IAudioDecoder *IAudioDecoder::createAudioDecoder(const std::string &type, NLMISC { return new CAudioDecoderVorbis(stream, loop); } +#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ else if (type_lower == "mp3") { return new CAudioDecoderMP3(stream, loop); } +#endif else { nlwarning("Music file type unknown: '%s'", type_lower.c_str()); diff --git a/code/nel/src/sound/audio_decoder_mp3.cpp b/code/nel/src/sound/audio_decoder_mp3.cpp index dc740bec0..fd8b1721c 100644 --- a/code/nel/src/sound/audio_decoder_mp3.cpp +++ b/code/nel/src/sound/audio_decoder_mp3.cpp @@ -17,6 +17,8 @@ #include "stdsound.h" +#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ + #include #define DR_MP3_IMPLEMENTATION @@ -221,4 +223,6 @@ void CAudioDecoderMP3::setLooping(bool loop) } /* namespace NLSOUND */ +#endif /* (NL_COMP_VC_VERSION > 90) */ + /* end of file */