From fb3d9c9d58a00e6ab4e062aa45200764ac8f205a Mon Sep 17 00:00:00 2001 From: comex Date: Mon, 22 Sep 2014 21:02:21 -0400 Subject: [PATCH] Fix warning in x64CPUDetect.cpp in generic build by not building it. --- Source/Core/Common/CMakeLists.txt | 7 ++++--- Source/Core/Common/GenericCPUDetect.cpp | 14 ++++++++++++++ Source/Core/Common/x64CPUDetect.cpp | 8 +------- 3 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 Source/Core/Common/GenericCPUDetect.cpp diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index 9c5f5488f7..1a93dfd0f6 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -45,12 +45,13 @@ if(_M_ARM) else() if(_M_X86) #X86 set(SRCS ${SRCS} - x64FPURoundMode.cpp) + x64FPURoundMode.cpp + x64CPUDetect.cpp) else() # Generic set(SRCS ${SRCS} - GenericFPURoundMode.cpp) + GenericFPURoundMode.cpp + GenericCPUDetect.cpp) endif() - set(SRCS ${SRCS} x64CPUDetect.cpp) endif() if(WIN32) set(SRCS ${SRCS} ExtendedTrace.cpp) diff --git a/Source/Core/Common/GenericCPUDetect.cpp b/Source/Core/Common/GenericCPUDetect.cpp new file mode 100644 index 0000000000..5f135bb7a2 --- /dev/null +++ b/Source/Core/Common/GenericCPUDetect.cpp @@ -0,0 +1,14 @@ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#include "Common/CPUDetect.h" + +CPUInfo cpu_info; + +CPUInfo::CPUInfo() {} + +std::string CPUInfo::Summarize() +{ + return "Generic"; +} diff --git a/Source/Core/Common/x64CPUDetect.cpp b/Source/Core/Common/x64CPUDetect.cpp index 0da02d0fb4..d0dab9a256 100644 --- a/Source/Core/Common/x64CPUDetect.cpp +++ b/Source/Core/Common/x64CPUDetect.cpp @@ -13,9 +13,7 @@ #else //#include -#ifndef _M_GENERIC #include -#endif #if defined __FreeBSD__ #include @@ -24,9 +22,7 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { -#if defined _M_GENERIC - (*eax) = (*ebx) = (*ecx) = (*edx) = 0; -#elif defined _LP64 +#if defined _LP64 // Note: EBX is reserved on Mac OS X and in PIC on Linux, so it has to // restored at the end of the asm block. __asm__ ( @@ -71,11 +67,9 @@ static void __cpuid(int info[4], int x) #define _XCR_XFEATURE_ENABLED_MASK 0 static unsigned long long _xgetbv(unsigned int index) { -#ifndef _M_GENERIC unsigned int eax, edx; __asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index)); return ((unsigned long long)edx << 32) | eax; -#endif } #endif