Misc. Linux improvements and bug fixes. (#121)

Co-authored-by: Tom Lally <tomlally@protonmail.com>
This commit is contained in:
Tom Lally 2022-09-01 19:46:20 +01:00 committed by GitHub
parent b8d4cf5b29
commit d3a7b3b5a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 101 additions and 104 deletions

View file

@ -228,11 +228,39 @@ typedef union _LARGE_INTEGER {
#if defined(_MSC_VER)
#define DLLEXPORT __declspec(dllexport)
#elif defined(__GNUC__)
#define DLLEXPORT __attribute__((dllexport))
#if BOOST_OS_WINDOWS
#define DLLEXPORT __attribute__((dllexport))
#else
#define DLLEXPORT
#endif
#else
#error No definition for DLLEXPORT
#endif
#ifdef __GNUC__
#include <cpuid.h>
#endif
inline void cpuid(int cpuInfo[4], int functionId) {
#if defined(_MSC_VER)
__cpuid(cpuInfo, functionId);
#elif defined(__GNUC__)
__cpuid(functionId, cpuInfo[0], cpuInfo[1], cpuInfo[2], cpuInfo[3]);
#else
#error No definition for cpuid
#endif
}
inline void cpuidex(int cpuInfo[4], int functionId, int subFunctionId) {
#if defined(_MSC_VER)
__cpuidex(cpuInfo, functionId, subFunctionId);
#elif defined(__GNUC__)
__cpuid_count(functionId, subFunctionId, cpuInfo[0], cpuInfo[1], cpuInfo[2], cpuInfo[3]);
#else
#error No definition for cpuidex
#endif
}
// MEMPTR
#include "Common/MemPtr.h"