From f15aeb26b37d88c451887709ead523e5aeb49390 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Fri, 24 Feb 2012 19:20:17 -0600 Subject: [PATCH 1/4] Use an auto typed variable in IniFile.cpp --- Source/Core/Common/Src/IniFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp index c81c060f1d..f51e8850d3 100644 --- a/Source/Core/Common/Src/IniFile.cpp +++ b/Source/Core/Common/Src/IniFile.cpp @@ -459,7 +459,7 @@ bool IniFile::Save(const char* filename) return false; } - for (std::vector
::const_iterator iter = sections.begin(); iter != sections.end(); ++iter) + for (auto iter = sections.begin(); iter != sections.end(); ++iter) { const Section& section = *iter; From 8a8dc77ef19446f97d210f0602aaa218144adf0e Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Fri, 24 Feb 2012 14:19:24 -0600 Subject: [PATCH 2/4] enable c++11 compilation in cmakelists --- CMakeLists.txt | 1 + Source/Core/Common/Src/StdThread.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80584b2555..c59e3f7c07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -552,6 +552,7 @@ option(UNITTESTS "Build unitests" OFF) ######################################## # Start compiling our code # +add_definitions(-std=c++0x) add_subdirectory(Source) diff --git a/Source/Core/Common/Src/StdThread.h b/Source/Core/Common/Src/StdThread.h index 6e9e903561..b64dbf2c4e 100644 --- a/Source/Core/Common/Src/StdThread.h +++ b/Source/Core/Common/Src/StdThread.h @@ -7,7 +7,9 @@ #if GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__ // GCC 4.4 provides +#ifndef _GLIBCXX_USE_SCHED_YIELD #define _GLIBCXX_USE_SCHED_YIELD +#endif #include #else From f92d1e1e931db66d10db4cb2377bcb794dc898ee Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Fri, 24 Feb 2012 14:25:02 -0600 Subject: [PATCH 3/4] fix some clang compilation errors --- Source/Core/VideoCommon/Src/AVIDump.cpp | 2 +- Source/Core/VideoCommon/Src/BPMemory.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/Src/AVIDump.cpp b/Source/Core/VideoCommon/Src/AVIDump.cpp index 469e00d9f5..670693690b 100644 --- a/Source/Core/VideoCommon/Src/AVIDump.cpp +++ b/Source/Core/VideoCommon/Src/AVIDump.cpp @@ -263,7 +263,7 @@ bool AVIDump::CreateFile() s_Stream->codec->bit_rate = 400000; s_Stream->codec->width = s_width; s_Stream->codec->height = s_height; - s_Stream->codec->time_base = (AVRational){1, VideoInterface::TargetRefreshRate}; + s_Stream->codec->time_base = (AVRational){1, static_cast(VideoInterface::TargetRefreshRate)}; s_Stream->codec->gop_size = 12; s_Stream->codec->pix_fmt = g_Config.bUseFFV1 ? PIX_FMT_BGRA : PIX_FMT_YUV420P; diff --git a/Source/Core/VideoCommon/Src/BPMemory.cpp b/Source/Core/VideoCommon/Src/BPMemory.cpp index da09893f35..5c4ed457e3 100644 --- a/Source/Core/VideoCommon/Src/BPMemory.cpp +++ b/Source/Core/VideoCommon/Src/BPMemory.cpp @@ -61,7 +61,7 @@ void BPReload() // Cases in which we DON'T want to reload the BP continue; default: - BPCmd bp = {i, 0xFFFFFF, ((u32*)&bpmem)[i]}; + BPCmd bp = {i, 0xFFFFFF, static_cast(((u32*)&bpmem)[i])}; BPWritten(bp); } } From 38823b63716b46ec00337f20127de43661deac8b Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 28 Feb 2012 00:27:16 -0600 Subject: [PATCH 4/4] Add comment here so people know what's up. --- Source/Core/Common/Src/IniFile.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp index f51e8850d3..acad498106 100644 --- a/Source/Core/Common/Src/IniFile.cpp +++ b/Source/Core/Common/Src/IniFile.cpp @@ -459,6 +459,10 @@ bool IniFile::Save(const char* filename) return false; } + // Currently testing if dolphin community can handle the requirements of C++11 compilation + // If you get a compiler error on this line, your compiler is probably old. + // Update to g++ 4.4 or a recent version of clang (XCode 4.2 on OS X). + // If you don't want to update, complain in a google code issue, the dolphin forums or #dolphin-emu. for (auto iter = sections.begin(); iter != sections.end(); ++iter) { const Section& section = *iter;