Skip to content

Commit

Permalink
Do not use cpuid outside x86 architectures in disasmtool.
Browse files Browse the repository at this point in the history
  • Loading branch information
vlutas committed May 7, 2024
1 parent 9a66dc0 commit 173e2e2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions disasmtool/disasmtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#define _CRT_SECURE_NO_WARNINGS
#include <Windows.h>
#include <Intrin.h>
#else
#include <cpuid.h>
#endif // WIN32

#include <stdbool.h>
Expand All @@ -23,6 +21,11 @@

#include "disasmtool.h"

#if !defined(WIN32) && (defined(ND_ARCH_X64) || defined(ND_ARCH_X86))
#include <cpuid.h>
#endif // defined(ND_ARCH_X64) || defined(ND_ARCH_X86)



const char *gSpaces[16] =
{
Expand Down Expand Up @@ -71,6 +74,7 @@ nd_memset(void *s, int c, size_t n)
#endif // !defined(BDDISASM_HAS_MEMSET)


#if defined(ND_ARCH_X64) || defined(ND_ARCH_X86)
#ifdef WIN32
#define cpuid __cpuid
#else
Expand All @@ -82,7 +86,8 @@ void cpuid(int cpuInfo[4], int function_id)
unsigned int *cpuinfo = (unsigned int *)cpuInfo;
__get_cpuid(function_id, &cpuinfo[0], &cpuinfo[1], &cpuinfo[2], &cpuinfo[3]);
}
#endif //WIN32
#endif // WIN32
#endif // defined(ND_ARCH_X64) || defined(ND_ARCH_X86)


#define FG_Black "\033[1;30m"
Expand Down

0 comments on commit 173e2e2

Please sign in to comment.