From 837046218e389b6234aa1820e199843f471ab035 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sun, 12 Jul 2015 19:24:05 +0100 Subject: [PATCH] windows: Don't log errors for PS2EsetEmuVersion On wxWidgets3.0, using GetSymbol() on a nonexistent symbol causes error messages to be logged. This causes all plugins except GSdx to output error messages when an attempt to load the PS2EsetEmuVersion symbol fails. Suppress the error message - it'll probably just cause unnecessary confusion. --- pcsx2/PluginManager.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pcsx2/PluginManager.cpp b/pcsx2/PluginManager.cpp index 28b8a23032..18745b0b28 100644 --- a/pcsx2/PluginManager.cpp +++ b/pcsx2/PluginManager.cpp @@ -855,19 +855,22 @@ SysCorePlugins::PluginStatus_t::PluginStatus_t( PluginsEnum_t _pid, const wxStri _PS2EgetLibName GetLibName = (_PS2EgetLibName) Lib.GetSymbol( L"PS2EgetLibName" ); _PS2EgetLibVersion2 GetLibVersion2 = (_PS2EgetLibVersion2) Lib.GetSymbol( L"PS2EgetLibVersion2" ); -#ifdef __linux__ - _PS2EsetEmuVersion SetEmuVersion = NULL; -#else - _PS2EsetEmuVersion SetEmuVersion = (_PS2EsetEmuVersion) Lib.GetSymbol( L"PS2EsetEmuVersion" ); -#endif if( GetLibName == NULL || GetLibVersion2 == NULL ) throw Exception::PluginLoadError( pid ).SetStreamName(Filename) .SetDiagMsg(L"%s plugin init failed: Method binding failure on GetLibName or GetLibVersion2.") .SetUserMsg(_( "The configured %s plugin is not a PCSX2 plugin, or is for an older unsupported version of PCSX2.")); - if( SetEmuVersion != NULL ) - SetEmuVersion("PCSX2", (PCSX2_VersionHi << 24) | (PCSX2_VersionMid << 16) | (PCSX2_VersionLo << 8) | 0); + // Only Windows GSdx uses this. Should be removed in future after GSdx no longer relies on it to show the new config dialog. +#ifdef _WIN32 + // Since only Windows Gsdx has this symbol, that means every other plugin is going to cause error messages to be logged. + // Let's not do that for a hack function. + if (Lib.HasSymbol(L"PS2EsetEmuVersion")) { + _PS2EsetEmuVersion SetEmuVersion = (_PS2EsetEmuVersion)Lib.GetSymbol(L"PS2EsetEmuVersion"); + if (SetEmuVersion) + SetEmuVersion("PCSX2", (PCSX2_VersionHi << 24) | (PCSX2_VersionMid << 16) | (PCSX2_VersionLo << 8) | 0); + } +#endif Name = fromUTF8( GetLibName() ); int version = GetLibVersion2( tbl_PluginInfo[pid].typemask );