diff --git a/panda/src/display/graphicsPipe.cxx b/panda/src/display/graphicsPipe.cxx index 937987f567..52ccfa426d 100644 --- a/panda/src/display/graphicsPipe.cxx +++ b/panda/src/display/graphicsPipe.cxx @@ -55,25 +55,6 @@ union cpuid_info { }; }; -/** - * Returns the highest cpuid leaf that is supported by the CPU. - */ -static inline uint32_t get_cpuid_max(uint32_t leaf) { -#if defined(__GNUC__) && !defined(__APPLE__) - return __get_cpuid_max(leaf, nullptr); -#elif defined(_MSC_VER) - uint32_t p[4] = {0}; - __cpuid((int *)p, leaf); - return p[0]; -#else - unsigned int eax = 0; - __asm__ ("cpuid\n\t" - : "=a" (eax) - : "0" (leaf)); - return eax; -#endif -} - /** * Gets cpuid info for the given leaf. */ @@ -88,6 +69,19 @@ static inline void get_cpuid(uint32_t leaf, cpuid_info &info) { : "0" (leaf)); #endif } + +/** + * Returns the highest cpuid leaf that is supported by the CPU. + */ +static inline uint32_t get_cpuid_max(uint32_t leaf) { +#if defined(__GNUC__) && !defined(__APPLE__) + return __get_cpuid_max(leaf, nullptr); +#else + cpuid_info info; + get_cpuid(leaf, info); + return info.eax; +#endif +} #endif #ifdef IS_LINUX