Fix compile error for ancient clangs

This commit is contained in:
rdb 2017-02-10 00:07:45 +01:00
parent 18f09c48dd
commit fdffcc280b
2 changed files with 8 additions and 7 deletions

View File

@ -17,7 +17,7 @@
// For __rdtsc
#ifdef _MSC_VER
#include <intrin.h>
#elif defined(__GNUC__) && !defined(__APPLE__)
#elif defined(__GNUC__) && !defined(__clang__)
#include <x86intrin.h>
#endif
@ -529,7 +529,7 @@ get_cpu_frequency() {
*/
uint64_t DisplayInformation::
get_cpu_time() {
#if defined(_MSC_VER) || (defined(__GNUC__) && !defined(__APPLE__))
#if defined(_MSC_VER) || (defined(__GNUC__) && !defined(__clang__))
return __rdtsc();
#else
unsigned int lo, hi = 0;

View File

@ -141,14 +141,15 @@ GraphicsPipe() :
}
if (max_extended >= 0x80000004) {
string brand;
char brand[49];
get_cpuid(0x80000002, info);
brand += string(info.str, strnlen(info.str, 16));
memcpy(brand, info.str, 16);
get_cpuid(0x80000003, info);
brand += string(info.str, strnlen(info.str, 16));
memcpy(brand + 16, info.str, 16);
get_cpuid(0x80000004, info);
brand += string(info.str, strnlen(info.str, 16));
_display_information->_cpu_brand_string = move(brand);
memcpy(brand + 32, info.str, 16);
brand[48] = 0;
_display_information->_cpu_brand_string = brand;
}
#if defined(IS_OSX)