summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2015-08-19 20:40:31 -0400
committerGravatar bunnei2015-08-19 20:40:31 -0400
commit21ba05e5f1a571dd26fd5bf06afcb993b1ca301f (patch)
tree79f9971851cfe9d416f07367e5f592972a086e4b
parentMerge pull request #1055 from aroulin/shader-sge-sgei-slt (diff)
parentFix building under MinGW (diff)
downloadyuzu-21ba05e5f1a571dd26fd5bf06afcb993b1ca301f.tar.gz
yuzu-21ba05e5f1a571dd26fd5bf06afcb993b1ca301f.tar.xz
yuzu-21ba05e5f1a571dd26fd5bf06afcb993b1ca301f.zip
Merge pull request #1035 from darkf/mingw-fix
Fix building under MinGW
-rw-r--r--CMakeLists.txt3
-rw-r--r--src/common/common_funcs.h12
-rw-r--r--src/common/file_util.h2
3 files changed, 12 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 00d71dbdc..6cdac1177 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -155,7 +155,8 @@ IF (APPLE)
155 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") 155 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
156ELSEIF(MINGW) 156ELSEIF(MINGW)
157 # GCC does not support codecvt, so use iconv instead 157 # GCC does not support codecvt, so use iconv instead
158 set(PLATFORM_LIBRARIES winmm ws2_32 iconv) 158 # PSAPI is the Process Status API
159 set(PLATFORM_LIBRARIES winmm ws2_32 psapi iconv)
159 160
160 # WSAPoll functionality doesn't exist before WinNT 6.x (Vista and up) 161 # WSAPoll functionality doesn't exist before WinNT 6.x (Vista and up)
161 add_definitions(-D_WIN32_WINNT=0x0600) 162 add_definitions(-D_WIN32_WINNT=0x0600)
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 88e452a16..ed20c3629 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -45,14 +45,20 @@
45 45
46// GCC 4.8 defines all the rotate functions now 46// GCC 4.8 defines all the rotate functions now
47// Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit 47// Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit
48#ifndef _rotl 48#ifdef _rotl
49inline u32 _rotl(u32 x, int shift) { 49#define rotl _rotl
50#else
51inline u32 rotl(u32 x, int shift) {
50 shift &= 31; 52 shift &= 31;
51 if (!shift) return x; 53 if (!shift) return x;
52 return (x << shift) | (x >> (32 - shift)); 54 return (x << shift) | (x >> (32 - shift));
53} 55}
56#endif
54 57
55inline u32 _rotr(u32 x, int shift) { 58#ifdef _rotr
59#define rotr _rotr
60#else
61inline u32 rotr(u32 x, int shift) {
56 shift &= 31; 62 shift &= 31;
57 if (!shift) return x; 63 if (!shift) return x;
58 return (x >> shift) | (x << (32 - shift)); 64 return (x >> shift) | (x << (32 - shift));
diff --git a/src/common/file_util.h b/src/common/file_util.h
index d0dccdf69..e71a9b2fa 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -244,7 +244,7 @@ private:
244template <typename T> 244template <typename T>
245void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmode openmode) 245void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmode openmode)
246{ 246{
247#ifdef _WIN32 247#ifdef _MSC_VER
248 fstream.open(Common::UTF8ToTStr(filename).c_str(), openmode); 248 fstream.open(Common::UTF8ToTStr(filename).c_str(), openmode);
249#else 249#else
250 fstream.open(filename.c_str(), openmode); 250 fstream.open(filename.c_str(), openmode);