From 61813767c77eb74cb3fa58b21fe7686047ba2b43 Mon Sep 17 00:00:00 2001 From: comex Date: Sat, 25 Jun 2016 23:37:47 -0400 Subject: [PATCH 1/3] Get rid of #define PAGE_MASK and round_page, which conflict with OS X headers --- Source/Core/Common/MemoryUtil.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp index 61b1ee303c..aa284ab091 100644 --- a/Source/Core/Common/MemoryUtil.cpp +++ b/Source/Core/Common/MemoryUtil.cpp @@ -31,10 +31,13 @@ // Uncomment the following line to be able to run Dolphin in Valgrind. //#undef MAP_32BIT -#if !defined(_WIN32) && defined(_M_X86_64) && !defined(MAP_32BIT) +#if !defined(_WIN32) #include -#define PAGE_MASK (getpagesize() - 1) -#define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK)) +static uintptr_t RoundPage(uintptr_t addr) +{ + uintptr_t mask = getpagesize() - 1; + return (addr + mask) & ~mask; +} #endif // This is purposely not a full wrapper for virtualalloc/mmap, but it @@ -54,7 +57,7 @@ void* AllocateExecutableMemory(size_t size, bool low) // effect of discarding already mapped pages that happen to be in the // requested virtual memory range (such as the emulated RAM, sometimes). if (low && (!map_hint)) - map_hint = (char*)round_page(512 * 1024 * 1024); /* 0.5 GB rounded up to the next page */ + map_hint = (char*)RoundPage(512 * 1024 * 1024); /* 0.5 GB rounded up to the next page */ #endif void* ptr = mmap(map_hint, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE #if defined(_M_X86_64) && defined(MAP_32BIT) @@ -81,7 +84,7 @@ void* AllocateExecutableMemory(size_t size, bool low) if (low) { map_hint += size; - map_hint = (char*)round_page(map_hint); /* round up to the next page */ + map_hint = (char*)RoundPage((uintptr_t)map_hint); /* round up to the next page */ } } #endif From fe73ae85262e7e8722deaa73835f4d230f97bc29 Mon Sep 17 00:00:00 2001 From: comex Date: Sat, 25 Jun 2016 23:39:50 -0400 Subject: [PATCH 2/3] Add missing override --- Source/Core/VideoBackends/Null/PerfQuery.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/Null/PerfQuery.h b/Source/Core/VideoBackends/Null/PerfQuery.h index 54a2d03cdb..ce6ba7263e 100644 --- a/Source/Core/VideoBackends/Null/PerfQuery.h +++ b/Source/Core/VideoBackends/Null/PerfQuery.h @@ -18,7 +18,7 @@ public: void ResetQuery() override {} u32 GetQueryResult(PerfQueryType type) override { return 0; } void FlushResults() override {} - bool IsFlushed() const { return true; } + bool IsFlushed() const override { return true; } }; } // namespace From efef07293b5978bcf9a06d8b0c4f20819ecc62cd Mon Sep 17 00:00:00 2001 From: comex Date: Sat, 25 Jun 2016 23:52:32 -0400 Subject: [PATCH 3/3] Suppress deprecation warning. --- Source/Core/Core/Analytics.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Core/Analytics.cpp b/Source/Core/Core/Analytics.cpp index 0c0bb813b1..f423527d34 100644 --- a/Source/Core/Core/Analytics.cpp +++ b/Source/Core/Core/Analytics.cpp @@ -154,9 +154,15 @@ void DolphinAnalytics::MakeBaseBuilder() builder.AddData("os-type", "osx"); SInt32 osxmajor, osxminor, osxbugfix; +// Gestalt is deprecated, but the replacement (NSProcessInfo +// operatingSystemVersion) is only available on OS X 10.10, so we need to use +// it anyway. Change this someday when Dolphin depends on 10.10+. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" Gestalt(gestaltSystemVersionMajor, &osxmajor); Gestalt(gestaltSystemVersionMinor, &osxminor); Gestalt(gestaltSystemVersionBugFix, &osxbugfix); +#pragma GCC diagnostic pop builder.AddData("osx-ver-major", osxmajor); builder.AddData("osx-ver-minor", osxminor);