Dep/g3d: Build fix for gcc on windows

(cherry picked from commit 2371cabb29fbd650b3e059a8c983f35fa5d54442)
This commit is contained in:
Shauren authored and Ovahlord committed 2026-06-07 21:20:27 +02:00
1 parent 0419cbd612
commit 6c9785127f
5 files changed
+109 -7

No files matched your search

+3 -2
View File
@@ -42,6 +42,7 @@
#ifdef G3D_WINDOWS
# include <conio.h>
# include <crtdbg.h>
# include <sys/timeb.h>
# include "G3D/RegistryUtil.h"
#include <Ole2.h>
@@ -1717,7 +1718,7 @@ void System::cpuid(CPUIDFunction func, uint32& eax, uint32& ebx, uint32& ecx, ui
#if ! defined(__PIC__) || defined(__x86_64__)
// AT&T assembler syntax
asm volatile(
"movl $0, %%ecx \n\n" /* Wipe ecx */
"xor %%ecx, %%ecx \n\n" /* Wipe ecx */
"cpuid \n\t"
: "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
: "a"(func));
@@ -1725,7 +1726,7 @@ void System::cpuid(CPUIDFunction func, uint32& eax, uint32& ebx, uint32& ecx, ui
// AT&T assembler syntax
asm volatile(
"pushl %%ebx \n\t" /* save ebx */
"movl $0, %%ecx \n\n" /* Wipe ecx */
"xor %%ecx, %%ecx \n\n" /* Wipe ecx */
"cpuid \n\t"
"movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */
"popl %%ebx \n\t" /* restore the old ebx */