diff --git a/panda/src/display/displayInformation.cxx b/panda/src/display/displayInformation.cxx index ac357344a5..9bda75e0de 100644 --- a/panda/src/display/displayInformation.cxx +++ b/panda/src/display/displayInformation.cxx @@ -17,7 +17,7 @@ // For __rdtsc #ifdef _MSC_VER #include -#elif defined(__GNUC__) && !defined(__APPLE__) +#elif defined(__GNUC__) && !defined(__clang__) #include #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; diff --git a/panda/src/display/graphicsPipe.cxx b/panda/src/display/graphicsPipe.cxx index 7bf9df67a6..5c00b204a3 100644 --- a/panda/src/display/graphicsPipe.cxx +++ b/panda/src/display/graphicsPipe.cxx @@ -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)