diff --git a/common/include/Utilities/EventSource.h b/common/include/Utilities/EventSource.h index 65eced950a..935418ffdc 100644 --- a/common/include/Utilities/EventSource.h +++ b/common/include/Utilities/EventSource.h @@ -19,6 +19,15 @@ class wxCommandEvent; +// __evt_fastcall : Work-around for a GCC 4.3 compilation bug. The templated FuncType +// throws type mismatches if we have a __fastcall qualifier. >_< --air + +#if defined( __GNUC__ ) && (__GNUC__ < 4 ) || ((__GNUC__ == 4) && ( __GNUC_MINOR__ <= 3 )) +# define __evt_fastcall +#else +# define __evt_fastcall +#endif + // -------------------------------------------------------------------------------------- // EventListener< typename EvtType > // -------------------------------------------------------------------------------------- @@ -26,7 +35,7 @@ class wxCommandEvent; template< typename EvtType > struct EventListener { - typedef void __fastcall FuncType( void* object, typename EvtType& evt ); + typedef void __evt_fastcall FuncType( void* object, EvtType& evt ); void* object; FuncType* OnEvent; diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index 06ff81af8c..512201d721 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -574,7 +574,7 @@ void memClearPageAddr(u32 vaddr) /////////////////////////////////////////////////////////////////////////// // PS2 Memory Init / Reset / Shutdown -static void __fastcall mmap_OnPageFault( void* basemem, PageFaultInfo& info ); +static void __evt_fastcall mmap_OnPageFault( void* basemem, PageFaultInfo& info ); static const uint m_allMemSize = Ps2MemSize::Rom + Ps2MemSize::Rom1 + Ps2MemSize::Rom2 + Ps2MemSize::ERom + @@ -894,7 +894,7 @@ static __forceinline void mmap_ClearCpuBlock( uint offset ) Cpu->Clear( m_PageProtectInfo[rampage].ReverseRamMap, 0x400 ); } -static void __fastcall mmap_OnPageFault( void* basemem, PageFaultInfo& info ) +static void __evt_fastcall mmap_OnPageFault( void* basemem, PageFaultInfo& info ) { // get bad virtual address uptr offset = info.addr - (uptr)basemem; diff --git a/pcsx2/RecoverySystem.cpp b/pcsx2/RecoverySystem.cpp index 5de0288bc2..2cba8be55e 100644 --- a/pcsx2/RecoverySystem.cpp +++ b/pcsx2/RecoverySystem.cpp @@ -34,7 +34,7 @@ int sys_resume_lock = 0; static FnType_OnThreadComplete* Callback_FreezeFinished = NULL; -static void __fastcall StateThread_OnAppStatus( void* thr, AppEventType& stat ) +static void __evt_fastcall StateThread_OnAppStatus( void* thr, AppEventType& stat ) { if( (thr == NULL) || (stat != AppStatus_Exiting) ) return; ((PersistentThread*)thr)->Cancel(); diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 96598d3c27..cf8f91e80f 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -250,7 +250,7 @@ void Pcsx2App::HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& } } -static void __fastcall OnStateSaveFinished( void* obj, wxCommandEvent& evt ) +static void __evt_fastcall OnStateSaveFinished( void* obj, wxCommandEvent& evt ) { if( evt.GetInt() == CoreStatus_Resumed ) { diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 8a8e0d50f3..5dcc68303d 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -255,28 +255,28 @@ void MainEmuFrame::InitLogBoxPosition( AppConfig::ConsoleLogOptions& conf ) } } -void __fastcall MainEmuFrame::OnCoreThreadStatusChanged( void* obj, wxCommandEvent& evt ) +void __evt_fastcall MainEmuFrame::OnCoreThreadStatusChanged( void* obj, wxCommandEvent& evt ) { if( obj == NULL ) return; MainEmuFrame* mframe = (MainEmuFrame*)obj; mframe->ApplyCoreStatus(); } -void __fastcall MainEmuFrame::OnCorePluginStatusChanged( void* obj, wxCommandEvent& evt ) +void __evt_fastcall MainEmuFrame::OnCorePluginStatusChanged( void* obj, wxCommandEvent& evt ) { if( obj == NULL ) return; MainEmuFrame* mframe = (MainEmuFrame*)obj; mframe->ApplyCoreStatus(); } -void __fastcall MainEmuFrame::OnSettingsApplied( void* obj, int& evt ) +void __evt_fastcall MainEmuFrame::OnSettingsApplied( void* obj, int& evt ) { if( obj == NULL ) return; MainEmuFrame* mframe = (MainEmuFrame*)obj; mframe->ApplySettings(); } -void __fastcall MainEmuFrame::OnSettingsLoadSave( void* obj, IniInterface& evt ) +void __evt_fastcall MainEmuFrame::OnSettingsLoadSave( void* obj, IniInterface& evt ) { if( obj == NULL ) return; MainEmuFrame* mframe = (MainEmuFrame*)obj; diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index c75bc1a42d..725abbda40 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -85,10 +85,10 @@ public: void ReloadRecentLists(); protected: - static void __fastcall OnCoreThreadStatusChanged( void* obj, wxCommandEvent& evt ); - static void __fastcall OnCorePluginStatusChanged( void* obj, wxCommandEvent& evt ); - static void __fastcall OnSettingsApplied( void* obj, int& evt ); - static void __fastcall OnSettingsLoadSave( void* obj, IniInterface& evt ); + static void __evt_fastcall OnCoreThreadStatusChanged( void* obj, wxCommandEvent& evt ); + static void __evt_fastcall OnCorePluginStatusChanged( void* obj, wxCommandEvent& evt ); + static void __evt_fastcall OnSettingsApplied( void* obj, int& evt ); + static void __evt_fastcall OnSettingsLoadSave( void* obj, IniInterface& evt ); void LoadSaveRecentIsoList( IniInterface& conf ); void ApplySettings();