summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2015-08-19 20:40:31 -0400
committerGravatar bunnei2015-08-19 20:40:31 -0400
commit21ba05e5f1a571dd26fd5bf06afcb993b1ca301f (patch)
tree79f9971851cfe9d416f07367e5f592972a086e4b /src
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
Diffstat (limited to 'src')
-rw-r--r--src/common/common_funcs.h12
-rw-r--r--src/common/file_util.h2
2 files changed, 10 insertions, 4 deletions
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);