From 4895e38bd59372e9813bb1b10f36ed49a438808f Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Fri, 29 Mar 2013 07:31:15 -0700 Subject: [PATCH] This change might work better if I git add the files --- CMakeLists.txt | 14 +++++----- Externals/wxWidgets3/build_wx.sh | 4 ++- Externals/wxWidgets3/wx/wxcocoa.h | 28 +++++++++---------- Source/Core/AudioCommon/Src/Mixer.h | 3 +- Source/Core/Common/Common.vcxproj | 5 +--- Source/Core/Common/Common.vcxproj.filters | 5 +--- Source/Core/Common/Src/LogManager.h | 2 +- Source/Core/Common/Src/Thread.h | 13 +++++++-- .../Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.h | 2 +- Source/Core/Core/Src/HW/EXI_DeviceMic.h | 2 +- Source/Core/DolphinWX/Src/ConfigMain.cpp | 11 ++------ 11 files changed, 43 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29e41047a1..5b2f436917 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,8 +168,8 @@ if(APPLE) set(ENV{PATH} /usr/bin:/bin:/usr/sbin:/sbin) # Some of our code contains Objective C constructs. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++ -stdlib=libc++") # Avoid mistaking an object file for a source file on the link command line. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -x none") @@ -180,10 +180,10 @@ if(APPLE) # This is inserted into the Info.plist as well. # Note that the SDK determines the maximum version of which optional # features can be used, not the minimum required version to run. - set(OSX_MIN_VERSION "10.5.4") + set(OSX_MIN_VERSION "10.7") set(TARGET_FLAGS "${TARGET_FLAGS} -mmacosx-version-min=${OSX_MIN_VERSION}") - set(SYSROOT_LEGACY_PATH "/Developer/SDKs/MacOSX10.6.sdk") - set(SYSROOT_PATH "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk") + set(SYSROOT_LEGACY_PATH "/Developer/SDKs/MacOSX10.7.sdk") + set(SYSROOT_PATH "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk") if(EXISTS "${SYSROOT_PATH}/") set(TARGET_SYSROOT ${SYSROOT_PATH}) elseif(EXISTS "${SYSROOT_LEGACY_PATH}/") @@ -197,8 +197,8 @@ if(APPLE) # This avoids a warning when linking with QuickTime. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_arch_warnings") # Specify target CPUs. - set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_x86_64 -mssse3") - set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_x86_64 -march=core2") + set(TARGET_FLAGS "${TARGET_FLAGS} -mssse3") + set(TARGET_FLAGS "${TARGET_FLAGS} -march=core2") # Target flags apply to both C and C++ compilation. # CMake passes these to the compiler on the link command line as well. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}") diff --git a/Externals/wxWidgets3/build_wx.sh b/Externals/wxWidgets3/build_wx.sh index 2173572bfa..82670d6e9f 100755 --- a/Externals/wxWidgets3/build_wx.sh +++ b/Externals/wxWidgets3/build_wx.sh @@ -5,7 +5,9 @@ cd wxWidgets case $OSTYPE in darwin*) +export CC=clang CXX=clang++ CFLAGS="-stdlib=libc++" CXXFLAGS="-stdlib=libc++" CPPFLAGS="-stdlib=libc++" BACKEND="osx_cocoa" +ADD_OPTS=--with-macosx-version-min=10.7 --enable-stl ;; linux*) BACKEND="gtk" @@ -15,5 +17,5 @@ esac mkdir build-local cd build-local -../configure --with-$BACKEND --disable-shared --enable-unicode --disable-compat28 --disable-exceptions --disable-fswatcher --without-regex --without-expat --disable-xml --disable-ribbon --disable-propgrid --disable-stc --disable-html --disable-richtext --without-libjpeg --without-libtiff --disable-webview --disable-markup +../configure --with-$BACKEND --disable-shared --enable-unicode --disable-compat28 --disable-exceptions --disable-fswatcher --without-regex --without-expat --disable-xml --disable-ribbon --disable-propgrid --disable-stc --disable-html --disable-richtext --without-libjpeg --without-libtiff --disable-webview --disable-markup $ADD_OPTS make diff --git a/Externals/wxWidgets3/wx/wxcocoa.h b/Externals/wxWidgets3/wx/wxcocoa.h index 841d17e949..33a19cda5b 100644 --- a/Externals/wxWidgets3/wx/wxcocoa.h +++ b/Externals/wxWidgets3/wx/wxcocoa.h @@ -16,7 +16,7 @@ #endif /* __cplusplus */ /* fill in with the string wxGetOsDescription() will return */ -#define WXWIN_OS_DESCRIPTION "Darwin 11.3.0 i386" +#define WXWIN_OS_DESCRIPTION "Darwin 11.4.2 x86_64" /* the installation location prefix from configure */ #define wxINSTALL_PREFIX "/usr/local" @@ -205,7 +205,7 @@ -#define wxUSE_STL 0 +#define wxUSE_STL 1 #if defined(__DMC__) || defined(__WATCOMC__) \ || (defined(_MSC_VER) && _MSC_VER < 1200) @@ -214,7 +214,7 @@ #define wxUSE_STD_DEFAULT 0 #endif -#define wxUSE_STD_CONTAINERS 0 +#define wxUSE_STD_CONTAINERS 1 #define wxUSE_STD_IOSTREAM 1 @@ -715,7 +715,7 @@ /* * Define if your compiler has compliant std::string::compare */ -/* #undef HAVE_STD_STRING_COMPARE */ +#define HAVE_STD_STRING_COMPARE 1 /* * Define if your compiler has */ @@ -736,12 +736,12 @@ /* * Define if your compiler has std::unordered_map */ -/* #undef HAVE_STD_UNORDERED_MAP */ +#define HAVE_STD_UNORDERED_MAP 1 /* * Define if your compiler has std::unordered_set */ -/* #undef HAVE_STD_UNORDERED_SET */ +#define HAVE_STD_UNORDERED_SET 1 /* * Define if your compiler has std::tr1::unordered_map @@ -756,12 +756,12 @@ /* * Define if your compiler has */ -#define HAVE_TR1_TYPE_TRAITS 1 +/* #undef HAVE_TR1_TYPE_TRAITS */ /* * Define if your compiler has */ -/* #undef HAVE_TYPE_TRAITS */ +#define HAVE_TYPE_TRAITS 1 /* * Define if the compiler supports simple visibility declarations. @@ -830,7 +830,7 @@ /* * Define if compiler has __thread keyword. */ -/* #undef HAVE___THREAD_KEYWORD */ +#define HAVE___THREAD_KEYWORD 1 /* * Define if large (64 bit file offsets) files are supported. */ @@ -996,25 +996,25 @@ #define HAVE_USLEEP 1 /* Define if you have wcscasecmp() function */ -/* #undef HAVE_WCSCASECMP 1 */ +#define HAVE_WCSCASECMP 1 /* Define if you have wcsncasecmp() function */ -/* #undef HAVE_WCSNCASECMP 1 */ +#define HAVE_WCSNCASECMP 1 /* Define if you have wcslen function */ #define HAVE_WCSLEN 1 /* Define if you have wcsdup function */ -/* #undef HAVE_WCSDUP 1 */ +#define HAVE_WCSDUP 1 /* Define if you have wcsftime() function */ #define HAVE_WCSFTIME 1 /* Define if you have strnlen() function */ -/* #undef HAVE_STRNLEN 1 */ +#define HAVE_STRNLEN 1 /* Define if you have wcsnlen() function */ -/* #undef HAVE_WCSNLEN 1 */ +#define HAVE_WCSNLEN 1 /* Define if you have wcstoull() and wcstoll() */ /* #undef HAVE_WCSTOULL */ diff --git a/Source/Core/AudioCommon/Src/Mixer.h b/Source/Core/AudioCommon/Src/Mixer.h index a9de2cee72..cbe11e572a 100644 --- a/Source/Core/AudioCommon/Src/Mixer.h +++ b/Source/Core/AudioCommon/Src/Mixer.h @@ -18,8 +18,9 @@ #ifndef _MIXER_H_ #define _MIXER_H_ +#include + #include "WaveFile.h" -#include "StdMutex.h" // 16 bit Stereo #define MAX_SAMPLES (1024 * 8) diff --git a/Source/Core/Common/Common.vcxproj b/Source/Core/Common/Common.vcxproj index 822fafe74b..12370296b9 100644 --- a/Source/Core/Common/Common.vcxproj +++ b/Source/Core/Common/Common.vcxproj @@ -241,9 +241,6 @@ - - - @@ -261,4 +258,4 @@ - \ No newline at end of file + diff --git a/Source/Core/Common/Common.vcxproj.filters b/Source/Core/Common/Common.vcxproj.filters index d427b70cdd..f8915af9a2 100644 --- a/Source/Core/Common/Common.vcxproj.filters +++ b/Source/Core/Common/Common.vcxproj.filters @@ -85,7 +85,6 @@ - @@ -119,8 +118,6 @@ Crypto - - @@ -134,4 +131,4 @@ {f078f36e-a0ff-4cd0-95f8-476100d68e68} - \ No newline at end of file + diff --git a/Source/Core/Common/Src/LogManager.h b/Source/Core/Common/Src/LogManager.h index f7ccb15034..9c3855982e 100644 --- a/Source/Core/Common/Src/LogManager.h +++ b/Source/Core/Common/Src/LogManager.h @@ -46,7 +46,7 @@ public: void Log(LogTypes::LOG_LEVELS, const char *msg); - bool IsValid() { return (m_logfile != NULL); } + bool IsValid() { return (bool)m_logfile; } bool IsEnabled() const { return m_enable; } void SetEnable(bool enable) { m_enable = enable; } diff --git a/Source/Core/Common/Src/Thread.h b/Source/Core/Common/Src/Thread.h index b5f899c43b..5ced2b2b3e 100644 --- a/Source/Core/Common/Src/Thread.h +++ b/Source/Core/Common/Src/Thread.h @@ -18,9 +18,16 @@ #ifndef _THREAD_H_ #define _THREAD_H_ -#include "StdThread.h" -#include "StdMutex.h" -#include "StdConditionVariable.h" +// has a bug in some versions of libc++: it uses _ as a variable. +// This conflicts with gettext's use of _ as a macro. +#undef _ + +#include +#include +#include + +// Restore _ +#define _(s) wxGetTranslation((s)) // Don't include common.h here as it will break LogManager #include "CommonTypes.h" diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.h b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.h index 8fd2a2af5f..eb9cf85a5a 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.h +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.h @@ -75,7 +75,7 @@ public: virtual void DoState(PointerWrap& p); // Needed because StdThread.h std::thread implem does not support member - // pointers. + // pointers. TODO(delroth): obsolete. static void SpawnAXThread(CUCode_AX* self); protected: diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMic.h b/Source/Core/Core/Src/HW/EXI_DeviceMic.h index b9596ba85a..4b94f6d723 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMic.h +++ b/Source/Core/Core/Src/HW/EXI_DeviceMic.h @@ -20,7 +20,7 @@ #if HAVE_PORTAUDIO -#include "StdMutex.h" +#include class CEXIMic : public IEXIDevice { diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index cbd780e6aa..d3c4a2ac43 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -18,6 +18,7 @@ #include // System #include #include +#include #include #include "Common.h" @@ -43,14 +44,6 @@ #include "Main.h" #include "VideoBackendBase.h" -#if defined(__APPLE__) -#include -using std::tr1::function; -#else -#include -using std::function; -#endif - #define TEXT_BOX(page, text) new wxStaticText(page, wxID_ANY, text, wxDefaultPosition, wxDefaultSize) struct CPUCore @@ -631,7 +624,7 @@ void CConfigMain::CreateGUIControls() theme_selection->SetStringSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name); // std::function = avoid error on msvc - theme_selection->Bind(wxEVT_COMMAND_CHOICE_SELECTED, function([theme_selection](wxEvent&) + theme_selection->Bind(wxEVT_COMMAND_CHOICE_SELECTED, std::function([theme_selection](wxEvent&) { SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name = theme_selection->GetStringSelection(); main_frame->InitBitmaps();