From: <man...@us...> - 2015-04-16 12:33:57
|
Revision: 4932 http://sourceforge.net/p/modplug/code/4932 Author: manxorist Date: 2015-04-16 12:33:50 +0000 (Thu, 16 Apr 2015) Log Message: ----------- [Fix] libopenmpt: Support GCC 4.3. GCC 4.3 had not been tested previously and failed to compile in both c++0x and c++98 modes. In c++98 mode, it does not support <cstdint> and in c++0x mode, it does not support unique_ptr and various other minor STL features. Make it work in c++0x mode with a tiny bit of support macros. Supporting c++98 mode is not feasable because we typedef our own std::int types in namespace std:: in the public header file which would conflict with clients compiling in c++0x mode. Modified Paths: -------------- trunk/OpenMPT/Makefile trunk/OpenMPT/README.md trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/libopenmpt/dox/changelog.md trunk/OpenMPT/libopenmpt/dox/dependencies.md trunk/OpenMPT/libopenmpt/dox/quickstart.md trunk/OpenMPT/libopenmpt/libopenmpt_config.h trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp trunk/OpenMPT/openmpt123/openmpt123.cpp trunk/OpenMPT/openmpt123/openmpt123_config.hpp trunk/OpenMPT/soundlib/Load_psm.cpp Modified: trunk/OpenMPT/Makefile =================================================================== --- trunk/OpenMPT/Makefile 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/Makefile 2015-04-16 12:33:50 UTC (rev 4932) @@ -47,7 +47,7 @@ # OPTIMIZE_SIZE=0 Build size-optimized binaries # TEST=1 Include test suite in default target. # ONLY_TEST=0 Only build the test suite. -# ANCIENT=0 Use a pre-C++0x compiler (i.e. GCC before 4.3) +# ANCIENT=0 Use a pre-C++0x compiler (i.e. GCC before 4.3.0) # STRICT=0 Treat warnings as errors. # CHECKED=0 Enable run-time assertions. # CHECKED_ADDRESS=0 Enable address sanitizer Modified: trunk/OpenMPT/README.md =================================================================== --- trunk/OpenMPT/README.md 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/README.md 2015-04-16 12:33:50 UTC (rev 4932) @@ -108,7 +108,7 @@ - mingw-w64: - The required version should be at least 4.4. Only 4.6 and up are + The required version should be at least 4.3. Only 4.6 and up are tested. make CONFIG=mingw64-win32 # for win32 @@ -119,7 +119,7 @@ The minimum required compiler versions are: - - gcc 4.4 + - gcc 4.3 - clang 3.0 Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/common/typedefs.h 2015-04-16 12:33:50 UTC (rev 4932) @@ -299,8 +299,9 @@ OPENMPT_NAMESPACE_END #include <cstdarg> +#include <stdarg.h> OPENMPT_NAMESPACE_BEGIN -#if MPT_COMPILER_MSVC +#if MPT_COMPILER_MSVC || (MPT_COMPILER_GCC && MPT_GCC_AT_LEAST(4,3,0) && MPT_GCC_BEFORE(4,4,0)) #ifndef va_copy #define va_copy(dst, src) do { (dst) = (src); } while (0) #endif Modified: trunk/OpenMPT/libopenmpt/dox/changelog.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/changelog.md 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/libopenmpt/dox/changelog.md 2015-04-16 12:33:50 UTC (rev 4932) @@ -19,6 +19,8 @@ preferred backend because SDL is more widespread and better tested on all kinds of different platforms, and in generel, SDL is just more reliable. + * libopenmpt now also supports GCC 4.3. + * libopenmpt now supports PLM (Disorder Tracker 2) files. * Various playback improvements and fixes for IT, S3M, XM, MOD, PTM and 669 Modified: trunk/OpenMPT/libopenmpt/dox/dependencies.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/dependencies.md 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/libopenmpt/dox/dependencies.md 2015-04-16 12:33:50 UTC (rev 4932) @@ -10,7 +10,7 @@ * Supported compilers for building libopenmpt: * **Microsoft Visual Studio 2010** or higher (2008 is partially supported) - * **GCC 4.4** or higher (4.1 to 4.3 are partially supported) + * **GCC 4.3** or higher (4.1 to 4.2 are partially supported) * **Clang 3.0** or higher * **MinGW-W64 4.6** or higher * **emscripten 1.21** or higher @@ -35,7 +35,7 @@ * Supported compilers for building openmpt: * **Microsoft Visual Studio 2010** or higher (2008 is partially supported) - * **GCC 4.4** or higher (4.1 to 4.3 are partially supported) + * **GCC 4.3** or higher (4.1 to 4.2 are partially supported) * **Clang 3.0** or higher * **MinGW-W64 4.6** or higher * any **C++11 compliant** compiler should also work Modified: trunk/OpenMPT/libopenmpt/dox/quickstart.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/quickstart.md 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/libopenmpt/dox/quickstart.md 2015-04-16 12:33:50 UTC (rev 4932) @@ -7,7 +7,7 @@ 1. Grab a `libopenmpt-autotools.VERSION.tar.gz` tarball. 2. Get dependencies: - - **gcc >= 4.4** or **clang >= 3.0** + - **gcc >= 4.3** or **clang >= 3.0** - **pkg-config >= 0.24** - **zlib** - **doxygen >= 1.8** @@ -40,7 +40,7 @@ 1. Get dependencies: - **GNU make** - - **gcc >= 4.4** or **clang >= 3.0** + - **gcc >= 4.3** or **clang >= 3.0** - **pkg-config** 2. *Optional*: - **zlib** Modified: trunk/OpenMPT/libopenmpt/libopenmpt_config.h =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_config.h 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/libopenmpt/libopenmpt_config.h 2015-04-16 12:33:50 UTC (rev 4932) @@ -98,12 +98,19 @@ #if defined(_MSC_VER) #if (_MSC_VER >= 1500) && (_MSC_VER < 1600) #define LIBOPENMPT_ANCIENT_COMPILER +#define LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +#define LIBOPENMPT_SHARE_PTR std::tr1::shared_ptr #endif #endif #if defined(__GNUC__) && !defined(__clang__) #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__*1 < 40300) #define LIBOPENMPT_ANCIENT_COMPILER +#define LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +#define LIBOPENMPT_SHARED_PTR std::tr1::shared_ptr +#elif (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__*1 < 40400) +#define LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +#define LIBOPENMPT_SHARED_PTR std::shared_ptr #endif #endif Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2015-04-16 12:33:50 UTC (rev 4932) @@ -174,14 +174,14 @@ class log_forwarder : public ILog { private: -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<log_interface> destination; +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<log_interface> destination; #else std::shared_ptr<log_interface> destination; #endif public: -#ifdef LIBOPENMPT_ANCIENT_COMPILER - log_forwarder( std::tr1::shared_ptr<log_interface> dest ) : destination(dest) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + log_forwarder( LIBOPENMPT_SHARED_PTR<log_interface> dest ) : destination(dest) { #else log_forwarder( std::shared_ptr<log_interface> dest ) : destination(dest) { #endif @@ -333,19 +333,19 @@ return !m_subsongs.empty(); } void module_impl::ctor( const std::map< std::string, std::string > & ctls ) { -#ifdef LIBOPENMPT_ANCIENT_COMPILER - m_sndFile = std::tr1::shared_ptr<CSoundFile>(new CSoundFile()); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + m_sndFile = LIBOPENMPT_SHARED_PTR<CSoundFile>(new CSoundFile()); #else m_sndFile = std::unique_ptr<CSoundFile>(new CSoundFile()); #endif m_loaded = false; -#ifdef LIBOPENMPT_ANCIENT_COMPILER - m_Dither = std::tr1::shared_ptr<Dither>(new Dither()); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + m_Dither = LIBOPENMPT_SHARED_PTR<Dither>(new Dither()); #else m_Dither = std::unique_ptr<Dither>(new Dither()); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - m_LogForwarder = std::tr1::shared_ptr<log_forwarder>(new log_forwarder(m_Log)); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + m_LogForwarder = LIBOPENMPT_SHARED_PTR<log_forwarder>(new log_forwarder(m_Log)); #else m_LogForwarder = std::unique_ptr<log_forwarder>(new log_forwarder(m_Log)); #endif @@ -478,18 +478,18 @@ std::transform( lowercase_ext.begin(), lowercase_ext.end(), lowercase_ext.begin(), tolower ); return std::find( extensions.begin(), extensions.end(), lowercase_ext ) != extensions.end(); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -double module_impl::could_open_propability( const OpenMPT::FileReader & file, double effort, std::tr1::shared_ptr<log_interface> log ) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +double module_impl::could_open_propability( const OpenMPT::FileReader & file, double effort, LIBOPENMPT_SHARED_PTR<log_interface> log ) { #else double module_impl::could_open_propability( const OpenMPT::FileReader & file, double effort, std::shared_ptr<log_interface> log ) { #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<CSoundFile> sndFile( new CSoundFile() ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<CSoundFile> sndFile( new CSoundFile() ); #else std::unique_ptr<CSoundFile> sndFile( new CSoundFile() ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<log_forwarder> logForwarder( new log_forwarder( log ) ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<log_forwarder> logForwarder( new log_forwarder( log ) ); #else std::unique_ptr<log_forwarder> logForwarder( new log_forwarder( log ) ); #endif @@ -524,8 +524,8 @@ } } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -double module_impl::could_open_propability( callback_stream_wrapper stream, double effort, std::tr1::shared_ptr<log_interface> log ) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +double module_impl::could_open_propability( callback_stream_wrapper stream, double effort, LIBOPENMPT_SHARED_PTR<log_interface> log ) { #else double module_impl::could_open_propability( callback_stream_wrapper stream, double effort, std::shared_ptr<log_interface> log ) { #endif @@ -536,16 +536,16 @@ fstream.tell = stream.tell; return could_open_propability( FileReader( fstream ), effort, log ); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -double module_impl::could_open_propability( std::istream & stream, double effort, std::tr1::shared_ptr<log_interface> log ) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +double module_impl::could_open_propability( std::istream & stream, double effort, LIBOPENMPT_SHARED_PTR<log_interface> log ) { #else double module_impl::could_open_propability( std::istream & stream, double effort, std::shared_ptr<log_interface> log ) { #endif return could_open_propability( FileReader( &stream ), effort, log ); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -module_impl::module_impl( callback_stream_wrapper stream, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +module_impl::module_impl( callback_stream_wrapper stream, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #else module_impl::module_impl( callback_stream_wrapper stream, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #endif @@ -558,8 +558,8 @@ load( FileReader( fstream ), ctls ); apply_libopenmpt_defaults(); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -module_impl::module_impl( std::istream & stream, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +module_impl::module_impl( std::istream & stream, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #else module_impl::module_impl( std::istream & stream, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #endif @@ -567,8 +567,8 @@ load( FileReader( &stream ), ctls ); apply_libopenmpt_defaults(); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -module_impl::module_impl( const std::vector<std::uint8_t> & data, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +module_impl::module_impl( const std::vector<std::uint8_t> & data, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #else module_impl::module_impl( const std::vector<std::uint8_t> & data, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #endif @@ -580,8 +580,8 @@ #endif apply_libopenmpt_defaults(); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -module_impl::module_impl( const std::vector<char> & data, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +module_impl::module_impl( const std::vector<char> & data, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #else module_impl::module_impl( const std::vector<char> & data, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #endif @@ -593,8 +593,8 @@ #endif apply_libopenmpt_defaults(); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -module_impl::module_impl( const std::uint8_t * data, std::size_t size, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +module_impl::module_impl( const std::uint8_t * data, std::size_t size, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #else module_impl::module_impl( const std::uint8_t * data, std::size_t size, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #endif @@ -602,8 +602,8 @@ load( FileReader( data, size ), ctls ); apply_libopenmpt_defaults(); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -module_impl::module_impl( const char * data, std::size_t size, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +module_impl::module_impl( const char * data, std::size_t size, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #else module_impl::module_impl( const char * data, std::size_t size, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #endif @@ -611,8 +611,8 @@ load( FileReader( data, size ), ctls ); apply_libopenmpt_defaults(); } -#ifdef LIBOPENMPT_ANCIENT_COMPILER -module_impl::module_impl( const void * data, std::size_t size, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR +module_impl::module_impl( const void * data, std::size_t size, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #else module_impl::module_impl( const void * data, std::size_t size, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ) : m_Log(log) { #endif @@ -768,8 +768,8 @@ double module_impl::get_duration_seconds() const { -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::tr1::shared_ptr<subsongs_type>() : std::tr1::shared_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<subsongs_type> subsongs_temp = has_subsongs_inited() ? LIBOPENMPT_SHARED_PTR<subsongs_type>() : LIBOPENMPT_SHARED_PTR<subsongs_type>( new subsongs_type( get_subsongs() ) ); #else std::unique_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::unique_ptr<subsongs_type>() : std::unique_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); #endif @@ -785,8 +785,8 @@ return subsongs[m_current_subsong].duration; } void module_impl::select_subsong( std::int32_t subsong ) { -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::tr1::shared_ptr<subsongs_type>() : std::tr1::shared_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<subsongs_type> subsongs_temp = has_subsongs_inited() ? LIBOPENMPT_SHARED_PTR<subsongs_type>() : LIBOPENMPT_SHARED_PTR<subsongs_type>( new subsongs_type( get_subsongs() ) ); #else std::unique_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::unique_ptr<subsongs_type>() : std::unique_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); #endif @@ -813,8 +813,8 @@ return m_currentPositionSeconds; } double module_impl::set_position_seconds( double seconds ) { -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::tr1::shared_ptr<subsongs_type>() : std::tr1::shared_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<subsongs_type> subsongs_temp = has_subsongs_inited() ? LIBOPENMPT_SHARED_PTR<subsongs_type>() : LIBOPENMPT_SHARED_PTR<subsongs_type>( new subsongs_type( get_subsongs() ) ); #else std::unique_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::unique_ptr<subsongs_type>() : std::unique_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); #endif @@ -1003,8 +1003,8 @@ } std::int32_t module_impl::get_num_subsongs() const { -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::tr1::shared_ptr<subsongs_type>() : std::tr1::shared_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<subsongs_type> subsongs_temp = has_subsongs_inited() ? LIBOPENMPT_SHARED_PTR<subsongs_type>() : LIBOPENMPT_SHARED_PTR<subsongs_type>( new subsongs_type( get_subsongs() ) ); #else std::unique_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::unique_ptr<subsongs_type>() : std::unique_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); #endif @@ -1029,8 +1029,8 @@ std::vector<std::string> module_impl::get_subsong_names() const { std::vector<std::string> retval; -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::tr1::shared_ptr<subsongs_type>() : std::tr1::shared_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<subsongs_type> subsongs_temp = has_subsongs_inited() ? LIBOPENMPT_SHARED_PTR<subsongs_type>() : LIBOPENMPT_SHARED_PTR<subsongs_type>( new subsongs_type( get_subsongs() ) ); #else std::unique_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::unique_ptr<subsongs_type>() : std::unique_ptr<subsongs_type>( new subsongs_type( get_subsongs() ) ); #endif Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp 2015-04-16 12:33:50 UTC (rev 4932) @@ -75,26 +75,26 @@ }; // struct subsong_data typedef std::vector<subsong_data> subsongs_type; static const std::int32_t all_subsongs = -1; -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<log_interface> m_Log; +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<log_interface> m_Log; #else std::shared_ptr<log_interface> m_Log; #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<log_forwarder> m_LogForwarder; +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<log_forwarder> m_LogForwarder; #else std::unique_ptr<log_forwarder> m_LogForwarder; #endif std::int32_t m_current_subsong; double m_currentPositionSeconds; -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<OpenMPT::CSoundFile> m_sndFile; +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<OpenMPT::CSoundFile> m_sndFile; #else std::unique_ptr<OpenMPT::CSoundFile> m_sndFile; #endif bool m_loaded; -#ifdef LIBOPENMPT_ANCIENT_COMPILER - std::tr1::shared_ptr<OpenMPT::Dither> m_Dither; +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + LIBOPENMPT_SHARED_PTR<OpenMPT::Dither> m_Dither; #else std::unique_ptr<OpenMPT::Dither> m_Dither; #endif @@ -124,56 +124,56 @@ std::size_t read_interleaved_wrapper( std::size_t count, std::size_t channels, float * interleaved ); std::pair< std::string, std::string > format_and_highlight_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int command ) const; std::pair< std::string, std::string > format_and_highlight_pattern_row_channel( std::int32_t p, std::int32_t r, std::int32_t c, std::size_t width, bool pad ) const; -#ifdef LIBOPENMPT_ANCIENT_COMPILER - static double could_open_propability( const OpenMPT::FileReader & file, double effort, std::tr1::shared_ptr<log_interface> log ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + static double could_open_propability( const OpenMPT::FileReader & file, double effort, LIBOPENMPT_SHARED_PTR<log_interface> log ); #else static double could_open_propability( const OpenMPT::FileReader & file, double effort, std::shared_ptr<log_interface> log ); #endif public: static std::vector<std::string> get_supported_extensions(); static bool is_extension_supported( const std::string & extension ); -#ifdef LIBOPENMPT_ANCIENT_COMPILER - static double could_open_propability( callback_stream_wrapper stream, double effort, std::tr1::shared_ptr<log_interface> log ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + static double could_open_propability( callback_stream_wrapper stream, double effort, LIBOPENMPT_SHARED_PTR<log_interface> log ); #else static double could_open_propability( callback_stream_wrapper stream, double effort, std::shared_ptr<log_interface> log ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - static double could_open_propability( std::istream & stream, double effort, std::tr1::shared_ptr<log_interface> log ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + static double could_open_propability( std::istream & stream, double effort, LIBOPENMPT_SHARED_PTR<log_interface> log ); #else static double could_open_propability( std::istream & stream, double effort, std::shared_ptr<log_interface> log ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - module_impl( callback_stream_wrapper stream, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + module_impl( callback_stream_wrapper stream, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ); #else module_impl( callback_stream_wrapper stream, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - module_impl( std::istream & stream, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + module_impl( std::istream & stream, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ); #else module_impl( std::istream & stream, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - module_impl( const std::vector<std::uint8_t> & data, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + module_impl( const std::vector<std::uint8_t> & data, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ); #else module_impl( const std::vector<std::uint8_t> & data, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - module_impl( const std::vector<char> & data, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + module_impl( const std::vector<char> & data, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ); #else module_impl( const std::vector<char> & data, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - module_impl( const std::uint8_t * data, std::size_t size, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + module_impl( const std::uint8_t * data, std::size_t size, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ); #else module_impl( const std::uint8_t * data, std::size_t size, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - module_impl( const char * data, std::size_t size, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + module_impl( const char * data, std::size_t size, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ); #else module_impl( const char * data, std::size_t size, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); #endif -#ifdef LIBOPENMPT_ANCIENT_COMPILER - module_impl( const void * data, std::size_t size, std::tr1::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); +#ifdef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR + module_impl( const void * data, std::size_t size, LIBOPENMPT_SHARED_PTR<log_interface> log, const std::map< std::string, std::string > & ctls ); #else module_impl( const void * data, std::size_t size, std::shared_ptr<log_interface> log, const std::map< std::string, std::string > & ctls ); #endif Modified: trunk/OpenMPT/openmpt123/openmpt123.cpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.cpp 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/openmpt123/openmpt123.cpp 2015-04-16 12:33:50 UTC (rev 4932) @@ -171,7 +171,7 @@ : impl(0) { if ( !flags.force_overwrite ) { -#if defined(OPENMPT123_ANCIENT_COMPILER) +#if defined(OPENMPT123_ANCIENT_COMPILER_FSTREAM) std::ifstream testfile( filename.c_str(), std::ios::binary ); #else std::ifstream testfile( filename, std::ios::binary ); @@ -1441,7 +1441,7 @@ file_stream.str( data ); filesize = data.length(); #elif defined(_MSC_VER) && defined(UNICODE) -#if defined(OPENMPT123_ANCIENT_COMPILER) +#if defined(OPENMPT123_ANCIENT_COMPILER_FSTREAM) file_stream.open( utf8_to_wstring( filename ).c_str(), std::ios::binary ); #else file_stream.open( utf8_to_wstring( filename ), std::ios::binary ); @@ -1450,7 +1450,7 @@ filesize = file_stream.tellg(); file_stream.seekg( 0, std::ios::beg ); #else -#if defined(OPENMPT123_ANCIENT_COMPILER) +#if defined(OPENMPT123_ANCIENT_COMPILER_FSTREAM) file_stream.open( filename.c_str(), std::ios::binary ); #else file_stream.open( filename, std::ios::binary ); Modified: trunk/OpenMPT/openmpt123/openmpt123_config.hpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123_config.hpp 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/openmpt123/openmpt123_config.hpp 2015-04-16 12:33:50 UTC (rev 4932) @@ -66,6 +66,7 @@ #if defined(_MSC_VER) #if (_MSC_VER >= 1500) && (_MSC_VER < 1600) #define OPENMPT123_ANCIENT_COMPILER +#define OPENMPT123_ANCIENT_COMPILER_FSTREAM #endif #endif @@ -73,7 +74,10 @@ #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__*1 < 40300) #define OPENMPT123_ANCIENT_COMPILER #endif +#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__*1 < 40400) +#define OPENMPT123_ANCIENT_COMPILER_FSTREAM #endif +#endif #ifdef OPENMPT123_ANCIENT_COMPILER #include <stdint.h> Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2015-04-13 13:27:38 UTC (rev 4931) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2015-04-16 12:33:50 UTC (rev 4932) @@ -526,7 +526,7 @@ chunkCount++; } // separate subsongs by "---" patterns - orderOffsets.push_back(nullptr); + orderOffsets.push_back(static_cast<FileReader*>(nullptr)); // GCC 4.3 does not like .push_back(nullptr) here Order.Append(); } case PSMChunk::idPPAN: // PPAN - Channel panning table (used in Sinaria) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |