From: <man...@us...> - 2015-04-17 13:58:18
|
Revision: 4938 http://sourceforge.net/p/modplug/code/4938 Author: manxorist Date: 2015-04-17 13:58:11 +0000 (Fri, 17 Apr 2015) Log Message: ----------- [Fix] Naming our noinline macro exactly so conflicts with the use of "__declspec(noinline)" in system headers as seen with the VS2013 provided SDK in certain cases. Rename our macro to MPT_NOINLINE. Modified Paths: -------------- trunk/OpenMPT/common/Logging.cpp trunk/OpenMPT/common/Logging.h trunk/OpenMPT/common/typedefs.cpp trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/mptrack/Ctrl_pat.h trunk/OpenMPT/mptrack/Ctrl_smp.h trunk/OpenMPT/mptrack/ExceptionHandler.cpp trunk/OpenMPT/mptrack/View_smp.h trunk/OpenMPT/soundlib/Dither.cpp trunk/OpenMPT/test/TestToolsLib.h trunk/OpenMPT/test/test.cpp Modified: trunk/OpenMPT/common/Logging.cpp =================================================================== --- trunk/OpenMPT/common/Logging.cpp 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/common/Logging.cpp 2015-04-17 13:58:11 UTC (rev 4938) @@ -39,8 +39,8 @@ #ifndef NO_LOGGING -static noinline void DoLog(const mpt::log::Context &context, mpt::ustring message) -//-------------------------------------------------------------------------------- +static MPT_NOINLINE void DoLog(const mpt::log::Context &context, mpt::ustring message) +//------------------------------------------------------------------------------------ { // remove eol if already present message = mpt::String::RTrim(message, MPT_USTRING("\r\n")); @@ -94,8 +94,8 @@ } -static noinline void DoLog(const mpt::log::Context &context, const char *format, va_list args) -//-------------------------------------------------------------------------------------------- +static MPT_NOINLINE void DoLog(const mpt::log::Context &context, const char *format, va_list args) +//------------------------------------------------------------------------------------------------ { char message[LOGBUF_SIZE]; va_list va; @@ -201,7 +201,7 @@ g_Enabled = false; } -noinline void Trace(const mpt::log::Context & context) +MPT_NOINLINE void Trace(const mpt::log::Context & context) { // This will get called in realtime contexts and hot paths. // No blocking allowed here. Modified: trunk/OpenMPT/common/Logging.h =================================================================== --- trunk/OpenMPT/common/Logging.h 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/common/Logging.h 2015-04-17 13:58:11 UTC (rev 4938) @@ -119,7 +119,7 @@ extern bool volatile g_Enabled; static inline bool IsEnabled() { return g_Enabled; } -noinline void Trace(const mpt::log::Context & contexxt); +MPT_NOINLINE void Trace(const mpt::log::Context & contexxt); enum ThreadKind { ThreadKindGUI, Modified: trunk/OpenMPT/common/typedefs.cpp =================================================================== --- trunk/OpenMPT/common/typedefs.cpp 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/common/typedefs.cpp 2015-04-17 13:58:11 UTC (rev 4938) @@ -18,8 +18,8 @@ #if !defined(MODPLUG_TRACKER) && defined(MPT_ASSERT_HANDLER_NEEDED) -noinline void AssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg) -//-------------------------------------------------------------------------------------------------------------- +MPT_NOINLINE void AssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg) +//------------------------------------------------------------------------------------------------------------------ { if(msg) { Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/common/typedefs.h 2015-04-17 13:58:11 UTC (rev 4938) @@ -99,13 +99,13 @@ // Advanced inline attributes #if MPT_COMPILER_MSVC #define forceinline __forceinline -#define noinline __declspec(noinline) +#define MPT_NOINLINE __declspec(noinline) #elif MPT_COMPILER_GCC || MPT_COMPILER_CLANG #define forceinline __attribute__((always_inline)) inline -#define noinline __attribute__((noinline)) +#define MPT_NOINLINE __attribute__((noinline)) #else #define forceinline inline -#define noinline +#define MPT_NOINLINE #endif @@ -271,7 +271,7 @@ #if defined(MPT_ASSERT_HANDLER_NEEDED) // custom assert handler needed -noinline void AssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg=nullptr); +MPT_NOINLINE void AssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg=nullptr); #endif // MPT_ASSERT_HANDLER_NEEDED Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.h 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2015-04-17 13:58:11 UTC (rev 4938) @@ -63,7 +63,7 @@ else if(!isSelectionKeyPressed && m_nScrollPos2nd != ORDERINDEX_INVALID) m_nScrollPos2nd = ORDERINDEX_INVALID; }; // Why VC wants to inline this huge function is beyond my understanding... - noinline bool SetCurSel(ORDERINDEX sel, bool bEdit = true, bool bShiftClick = false, bool bIgnoreCurSel = false, bool setPlayPos = true); + MPT_NOINLINE bool SetCurSel(ORDERINDEX sel, bool bEdit = true, bool bShiftClick = false, bool bIgnoreCurSel = false, bool setPlayPos = true); BOOL UpdateScrollInfo(); void UpdateInfoText(); int GetFontWidth(); Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.h 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2015-04-17 13:58:11 UTC (rev 4938) @@ -132,7 +132,7 @@ afx_msg void OnEnableStretchToSize(); afx_msg void OnEstimateSampleSize(); - noinline void SetModified(SampleHint hint, bool updateAll, bool waveformModified); + MPT_NOINLINE void SetModified(SampleHint hint, bool updateAll, bool waveformModified); //}}AFX_MSG DECLARE_MESSAGE_MAP() Modified: trunk/OpenMPT/mptrack/ExceptionHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/ExceptionHandler.cpp 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/mptrack/ExceptionHandler.cpp 2015-04-17 13:58:11 UTC (rev 4938) @@ -273,8 +273,8 @@ #if defined(MPT_ASSERT_HANDLER_NEEDED) -noinline void AssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg) -//-------------------------------------------------------------------------------------------------------------- +MPT_NOINLINE void AssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg) +//------------------------------------------------------------------------------------------------------------------ { DebugReporter report(msg ? DumpModeWarning : DumpModeCrash, nullptr); if(IsDebuggerPresent()) Modified: trunk/OpenMPT/mptrack/View_smp.h =================================================================== --- trunk/OpenMPT/mptrack/View_smp.h 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/mptrack/View_smp.h 2015-04-17 13:58:11 UTC (rev 4938) @@ -62,7 +62,7 @@ DECLARE_SERIAL(CViewSample) protected: - noinline void SetModified(SampleHint hint, bool updateAll, bool waveformModified); + MPT_NOINLINE void SetModified(SampleHint hint, bool updateAll, bool waveformModified); void UpdateScrollSize() { UpdateScrollSize(m_nZoom, true); } void UpdateScrollSize(int newZoom, bool forceRefresh, SmpLength centeredSample = SmpLength(-1)); BOOL SetCurrentSample(SAMPLEINDEX nSmp); Modified: trunk/OpenMPT/soundlib/Dither.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dither.cpp 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/soundlib/Dither.cpp 2015-04-17 13:58:11 UTC (rev 4938) @@ -165,8 +165,8 @@ template<int targetbits, int channels, int ditherdepth = 1, bool triangular = false, bool shaped = true> struct Dither_SimpleTemplate { -noinline void operator () (int *mixbuffer, std::size_t count, DitherSimpleState &state) -//------------------------------------------------------------------------------------- +MPT_NOINLINE void operator () (int *mixbuffer, std::size_t count, DitherSimpleState &state) +//----------------------------------------------------------------------------------------- { STATIC_ASSERT(sizeof(int) == 4); STATIC_ASSERT(FASTRAND_BITS * 3 >= (32-targetbits) - MIXING_ATTENUATION); Modified: trunk/OpenMPT/test/TestToolsLib.h =================================================================== --- trunk/OpenMPT/test/TestToolsLib.h 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/test/TestToolsLib.h 2015-04-17 13:58:11 UTC (rev 4938) @@ -158,7 +158,7 @@ private: template <typename Tx, typename Ty> - noinline void TypeCompareHelper(const Tx &x, const Ty &y) + MPT_NOINLINE void TypeCompareHelper(const Tx &x, const Ty &y) { if(!IsEqual(x, y, is_integer<Tx>(), is_integer<Ty>())) { @@ -170,7 +170,7 @@ public: template <typename Tfx, typename Tfy> - noinline void operator () (const Tfx &fx, const Tfy &fy) + MPT_NOINLINE void operator () (const Tfx &fx, const Tfy &fy) { ShowStart(); try @@ -197,7 +197,7 @@ public: template <typename Tx, typename Ty> - noinline void operator () (const Tx &x, const Ty &y) + MPT_NOINLINE void operator () (const Tx &x, const Ty &y) { ShowStart(); try Modified: trunk/OpenMPT/test/test.cpp =================================================================== --- trunk/OpenMPT/test/test.cpp 2015-04-17 13:34:13 UTC (rev 4937) +++ trunk/OpenMPT/test/test.cpp 2015-04-17 13:58:11 UTC (rev 4938) @@ -61,18 +61,18 @@ -static noinline void TestVersion(); -static noinline void TestTypes(); -static noinline void TestMisc(); -static noinline void TestCharsets(); -static noinline void TestStringFormatting(); -static noinline void TestSettings(); -static noinline void TestStringIO(); -static noinline void TestMIDIEvents(); -static noinline void TestSampleConversion(); -static noinline void TestITCompression(); -static noinline void TestPCnoteSerialization(); -static noinline void TestLoadSaveFile(); +static MPT_NOINLINE void TestVersion(); +static MPT_NOINLINE void TestTypes(); +static MPT_NOINLINE void TestMisc(); +static MPT_NOINLINE void TestCharsets(); +static MPT_NOINLINE void TestStringFormatting(); +static MPT_NOINLINE void TestSettings(); +static MPT_NOINLINE void TestStringIO(); +static MPT_NOINLINE void TestMIDIEvents(); +static MPT_NOINLINE void TestSampleConversion(); +static MPT_NOINLINE void TestITCompression(); +static MPT_NOINLINE void TestPCnoteSerialization(); +static MPT_NOINLINE void TestLoadSaveFile(); @@ -164,8 +164,8 @@ // Test if functions related to program version data work -static noinline void TestVersion() -//-------------------------------- +static MPT_NOINLINE void TestVersion() +//------------------------------------ { //Verify that macros and functions work. { @@ -249,8 +249,8 @@ // Test if data types are interpreted correctly -static noinline void TestTypes() -//------------------------------ +static MPT_NOINLINE void TestTypes() +//---------------------------------- { VERIFY_EQUAL(int8_min, (std::numeric_limits<int8>::min)()); VERIFY_EQUAL(int8_max, (std::numeric_limits<int8>::max)()); @@ -392,8 +392,8 @@ #endif -static noinline void TestStringFormatting() -//----------------------------------------- +static MPT_NOINLINE void TestStringFormatting() +//--------------------------------------------- { VERIFY_EQUAL(mpt::ToString(1.5f), "1.5"); @@ -508,8 +508,8 @@ } -static noinline void TestMisc() -//----------------------------- +static MPT_NOINLINE void TestMisc() +//--------------------------------- { VERIFY_EQUAL(EncodeIEEE754binary32(1.0f), 0x3f800000u); @@ -684,8 +684,8 @@ } -static noinline void TestCharsets() -//--------------------------------- +static MPT_NOINLINE void TestCharsets() +//------------------------------------- { // MPT_UTF8 version @@ -928,8 +928,8 @@ #endif // MODPLUG_TRACKER -static noinline void TestSettings() -//--------------------------------- +static MPT_NOINLINE void TestSettings() +//------------------------------------- { #ifdef MODPLUG_TRACKER @@ -1008,8 +1008,8 @@ // Test MIDI Event generating / reading -static noinline void TestMIDIEvents() -//----------------------------------- +static MPT_NOINLINE void TestMIDIEvents() +//--------------------------------------- { uint32 midiEvent; @@ -1824,8 +1824,8 @@ // Test file loading and saving -static noinline void TestLoadSaveFile() -//------------------------------------- +static MPT_NOINLINE void TestLoadSaveFile() +//----------------------------------------- { if(!ShouldRunTests()) { @@ -1977,8 +1977,8 @@ } -static noinline void TestITCompression() -//-------------------------------------- +static MPT_NOINLINE void TestITCompression() +//------------------------------------------ { // Test loading / saving of IT-compressed samples const int sampleDataSize = 65536; @@ -2032,8 +2032,8 @@ // Test PC note serialization -static noinline void TestPCnoteSerialization() -//-------------------------------------------- +static MPT_NOINLINE void TestPCnoteSerialization() +//------------------------------------------------ { FileReader file; MPT_SHARED_PTR<CSoundFile> pSndFile = mpt::make_shared<CSoundFile>(); @@ -2099,8 +2099,8 @@ // Test String I/O functionality -static noinline void TestStringIO() -//--------------------------------- +static MPT_NOINLINE void TestStringIO() +//------------------------------------- { char src0[4] = { '\0', 'X', ' ', 'X' }; // Weird empty buffer char src1[4] = { 'X', ' ', '\0', 'X' }; // Weird buffer (hello Impulse Tracker) @@ -2338,8 +2338,8 @@ } -static noinline void TestSampleConversion() -//----------------------------------------- +static MPT_NOINLINE void TestSampleConversion() +//--------------------------------------------- { uint8 *sourceBuf = new uint8[65536 * 4]; void *targetBuf = new uint8[65536 * 6]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |