From 67957b13b68a7230483ede370d61cb4053133fbc Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 8 Oct 2009 19:26:57 +0000 Subject: [PATCH] wxWidgets/Win32: Added a private heap allocation feature, which directs all wxString and wxObject allocations through a Windows private Heap (should reduce fragmentation and multithreaded contention when allocating/freeing blocks) (and fix some oddball compilation errors in spu2-x in rare circumstances) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1987 96395faa-99c1-11dd-bbfe-3dabce05a288 --- .../wxWidgets/build/msw/wx_base_2008.vcproj | 9 +++++ .../wxWidgets/build/msw/wx_config_2008.vcproj | 9 ++--- .../wxWidgets/build/msw/wx_core_2008.vcproj | 1 + 3rdparty/wxWidgets/include/wx/object.h | 35 +++++++++++++++++++ 3rdparty/wxWidgets/include/wx/setup.h | 16 ++++++++- 3rdparty/wxWidgets/include/wx/string.h | 9 ++++- 3rdparty/wxWidgets/src/common/init.cpp | 4 +++ plugins/spu2-x/src/Global.h | 2 ++ plugins/spu2-x/src/Windows/UIHelpers.cpp | 2 +- plugins/spu2-x/src/Windows/WinConfig.h | 2 ++ 10 files changed, 82 insertions(+), 7 deletions(-) diff --git a/3rdparty/wxWidgets/build/msw/wx_base_2008.vcproj b/3rdparty/wxWidgets/build/msw/wx_base_2008.vcproj index 1537079916..586a9fd15d 100644 --- a/3rdparty/wxWidgets/build/msw/wx_base_2008.vcproj +++ b/3rdparty/wxWidgets/build/msw/wx_base_2008.vcproj @@ -5,6 +5,7 @@ Name="wxBase28" ProjectGUID="{48AD7E0A-25B1-4974-A1E3-03F8C438D34F}" RootNamespace="wxBase28" + TargetFrameworkVersion="0" > + + @@ -693,6 +698,10 @@ RelativePath="..\..\include\wx\msw\gccpriv.h" > + + diff --git a/3rdparty/wxWidgets/build/msw/wx_config_2008.vcproj b/3rdparty/wxWidgets/build/msw/wx_config_2008.vcproj index 4019e465f2..55b89659b3 100644 --- a/3rdparty/wxWidgets/build/msw/wx_config_2008.vcproj +++ b/3rdparty/wxWidgets/build/msw/wx_config_2008.vcproj @@ -5,6 +5,7 @@ Name="wxConfig28" ProjectGUID="{C34487AF-228A-4D11-8E50-27803DF76873}" RootNamespace="wxConfig" + TargetFrameworkVersion="0" > + + @@ -160,10 +165,6 @@ /> - - +#if wxUSE_PRIVATE_HEAP && defined(__WXMSW__) +# include "wx/msw/HeapAllocator.h" +#endif #include "wx/afterstd.h" #if wxUSE_UNICODE #ifdef HAVE_STD_WSTRING - typedef std::wstring wxStdString; + #if wxUSE_PRIVATE_HEAP && defined(__WXMSW__) + typedef std::basic_string< wchar_t, std::char_traits< wchar_t >, wxStringAllocator > wxStdString; + #else + //typedef std::wstring wxStdString; + #endif #else typedef std::basic_string wxStdString; #endif diff --git a/3rdparty/wxWidgets/src/common/init.cpp b/3rdparty/wxWidgets/src/common/init.cpp index b440e54b21..bbf89a26b5 100644 --- a/3rdparty/wxWidgets/src/common/init.cpp +++ b/3rdparty/wxWidgets/src/common/init.cpp @@ -282,12 +282,16 @@ bool wxEntryStart(int& argc, wxChar **argv) } } + // PCSX2: Dunno why my operator new overload fails to work on this. Says it needs + // one with four parameters... ? + #if !wxUSE_PRIVATE_HEAP || !defined(__WXMSW__) if ( !app.get() ) { // either IMPLEMENT_APP() was not used at all or it failed -- in any // case we still need something app.Set(new wxDummyConsoleApp); } + #endif // wxApp initialization: this can be customized diff --git a/plugins/spu2-x/src/Global.h b/plugins/spu2-x/src/Global.h index f0db1b915b..e5e4efb908 100644 --- a/plugins/spu2-x/src/Global.h +++ b/plugins/spu2-x/src/Global.h @@ -18,6 +18,8 @@ #ifndef _SPU2X_GLOBAL_H_ #define _SPU2X_GLOBAL_H_ +#define NOMINMAX + struct StereoOut16; struct StereoOut32; struct StereoOutFloat; diff --git a/plugins/spu2-x/src/Windows/UIHelpers.cpp b/plugins/spu2-x/src/Windows/UIHelpers.cpp index 066fe41766..3909dcba32 100644 --- a/plugins/spu2-x/src/Windows/UIHelpers.cpp +++ b/plugins/spu2-x/src/Windows/UIHelpers.cpp @@ -63,7 +63,7 @@ __forceinline void Verifyc(HRESULT hr, const char* fn) void AssignSliderValue( HWND idcwnd, HWND hwndDisplay, int value ) { - value = min( max( value, 0 ), 512 ); + value = std::min( std::max( value, 0 ), 512 ); SendMessage(idcwnd,TBM_SETPOS,TRUE,value); wchar_t tbox[32]; diff --git a/plugins/spu2-x/src/Windows/WinConfig.h b/plugins/spu2-x/src/Windows/WinConfig.h index c768ecd0ae..0b39a163de 100644 --- a/plugins/spu2-x/src/Windows/WinConfig.h +++ b/plugins/spu2-x/src/Windows/WinConfig.h @@ -1,8 +1,10 @@ #pragma once +#ifndef WINVER # define WINVER 0x0501 # define _WIN32_WINNT 0x0501 +#endif #include #include