Remove HOST_OS references

This commit is contained in:
scribam 2021-03-13 11:37:13 +01:00
parent c61a66257f
commit 1cc3490f51
13 changed files with 20 additions and 42 deletions

View File

@ -131,20 +131,6 @@
#define DC_PLATFORM_HIKARU 5 /* Needs to be done, 2xsh4, 2x aica , custom vpu */
#define DC_PLATFORM_AURORA 6 /* Needs to be done, Uses newer 300 mhz sh4 + 150 mhz pvr mbx SoC */
//HOST_OS
#define OS_WINDOWS 0x10000001
#define OS_LINUX 0x10000002
#define OS_DARWIN 0x10000003
#define OS_IOS 0x10000004
#define OS_ANDROID 0x10000005
#define OS_UWP 0x10000011
#define OS_NSW_HOS 0x80000001
#define OS_PS4_BSD 0x80000002
//HOST_CPU
#define CPU_X86 0x20000001
#define CPU_ARM 0x20000002
@ -178,12 +164,6 @@
#define HOST_CPU CPU_GENERIC
#endif
#if defined(__APPLE__)
#define HOST_OS OS_DARWIN
#elif defined(__unix__)
#define HOST_OS OS_LINUX
#endif
#if defined(TARGET_NO_REC)
#define FEAT_SHREC DYNAREC_NONE
#define FEAT_AREC DYNAREC_NONE

View File

@ -34,7 +34,7 @@
alignas(4096) static u8 CodeBuffer[32 * 1024]
#if defined(_WIN32)
;
#elif HOST_OS == OS_LINUX
#elif defined(__unix__)
__attribute__((section(".text")));
#elif defined(__APPLE__)
__attribute__((section("__TEXT,.text")));

View File

@ -35,7 +35,7 @@
alignas(4096) static u8 CodeBuffer[32 * 1024]
#if defined(_WIN32)
;
#elif HOST_OS == OS_LINUX
#elif defined(__unix__)
__attribute__((section(".text")));
#elif defined(__APPLE__)
__attribute__((section("__TEXT,.text")));

View File

@ -51,11 +51,9 @@ void (*EntryPoints[ARAM_SIZE_MAX / 4])();
#ifdef _WIN32
alignas(4096) static u8 ARM7_TCB[ICacheSize];
#elif HOST_OS == OS_LINUX
#elif defined(__unix__)
alignas(4096) static u8 ARM7_TCB[ICacheSize] __attribute__((section(".text")));
#elif HOST_OS==OS_DARWIN
#elif defined(__APPLE__)
alignas(4096) static u8 ARM7_TCB[ICacheSize] __attribute__((section("__TEXT, .text")));
#else
#error ARM7_TCB ALLOC

View File

@ -15,7 +15,7 @@
#include "hw/sh4/sh4_sched.h"
#if HOST_OS==OS_LINUX && defined(DYNA_OPROF)
#if defined(__unix__) && defined(DYNA_OPROF)
#include <opagent.h>
op_agent_t oprofHandle;
#endif

View File

@ -24,7 +24,7 @@
u8 SH4_TCB[CODE_SIZE + TEMP_CODE_SIZE + 4096]
#if defined(_WIN32) || FEAT_SHREC != DYNAREC_JIT
;
#elif HOST_OS == OS_LINUX
#elif defined(__unix__)
__attribute__((section(".text")));
#elif defined(__APPLE__)
__attribute__((section("__TEXT,.text")));

View File

@ -78,7 +78,7 @@ static void SerialWrite(u32 addr, u32 data)
//SCIF_SCFSR2 read
static u32 ReadSerialStatus(u32 addr)
{
#if HOST_OS == OS_LINUX || defined(__APPLE__)
#if defined(__unix__) || defined(__APPLE__)
int count = 0;
if (config::SerialConsole && tty != 1
&& ioctl(tty, FIONREAD, &count) == 0 && count > 0)
@ -169,7 +169,7 @@ void serial_init()
//SCIF SCLSR2 0xFFE80024 0x1FE80024 16 0x0000 0x0000 Held Held Pclk
sh4_rio_reg(SCIF,SCIF_SCLSR2_addr,RIO_DATA,16);
#if HOST_OS == OS_LINUX || defined(__APPLE__)
#if defined(__unix__) || defined(__APPLE__)
if (config::SerialConsole && config::SerialPTY)
{
tty = open("/dev/ptmx", O_RDWR | O_NDELAY | O_NOCTTY | O_NONBLOCK);

View File

@ -1,6 +1,6 @@
#include "types.h"
#if HOST_OS==OS_LINUX
#if defined(__unix__)
#include "hw/sh4/dyna/blockmanager.h"
#include "log/LogManager.h"
#include "emulator.h"

View File

@ -1,6 +1,6 @@
#include "types.h"
#if HOST_OS==OS_LINUX || defined(__APPLE__)
#if defined(__unix__) || defined(__APPLE__)
#if defined(__APPLE__)
#define _XOPEN_SOURCE 1
#define __USE_GNU 1
@ -136,7 +136,7 @@ double os_GetSeconds()
void os_DebugBreak() {
__asm__("trap");
}
#elif HOST_OS != OS_LINUX
#elif !defined(__unix__)
void os_DebugBreak()
{
__builtin_trap();

View File

@ -37,7 +37,7 @@ static void context_segfault(host_context_t* hostctx, void* segfault_ctx)
for (int i = 0; i < 15; i++)
bicopy<ToSegfault>(hostctx->reg[i], MCTX(.__gregs[i]));
#elif HOST_OS == OS_LINUX
#elif defined(__unix__)
bicopy<ToSegfault>(hostctx->pc, MCTX(.arm_pc));
u32* reg =(u32*) &MCTX(.arm_r0);
@ -50,7 +50,7 @@ static void context_segfault(host_context_t* hostctx, void* segfault_ctx)
for (int i = 0; i < 15; i++)
bicopy<ToSegfault>(hostctx->reg[i], MCTX(->__ss.__r[i]));
#else
#error HOST_OS
#error "Unsupported OS"
#endif
#elif HOST_CPU == CPU_ARM64
#if defined(__APPLE__)
@ -68,7 +68,7 @@ static void context_segfault(host_context_t* hostctx, void* segfault_ctx)
bicopy<ToSegfault>(hostctx->esp, MCTX(.mc_esp));
bicopy<ToSegfault>(hostctx->eax, MCTX(.mc_eax));
bicopy<ToSegfault>(hostctx->ecx, MCTX(.mc_ecx));
#elif HOST_OS == OS_LINUX
#elif defined(__unix__)
bicopy<ToSegfault>(hostctx->pc, MCTX(.gregs[REG_EIP]));
bicopy<ToSegfault>(hostctx->esp, MCTX(.gregs[REG_ESP]));
bicopy<ToSegfault>(hostctx->eax, MCTX(.gregs[REG_EAX]));
@ -79,7 +79,7 @@ static void context_segfault(host_context_t* hostctx, void* segfault_ctx)
bicopy<ToSegfault>(hostctx->eax, MCTX(->__ss.__eax));
bicopy<ToSegfault>(hostctx->ecx, MCTX(->__ss.__ecx));
#else
#error HOST_OS
#error "Unsupported OS"
#endif
#elif HOST_CPU == CPU_X64
#if defined(__FreeBSD__) || defined(__DragonFly__)
@ -89,7 +89,7 @@ static void context_segfault(host_context_t* hostctx, void* segfault_ctx)
bicopy<ToSegfault>(hostctx->rsp, MCTX(.__gregs[REG_RSP]));
bicopy<ToSegfault>(hostctx->r9, MCTX(.__gregs[REG_R9]));
bicopy<ToSegfault>(hostctx->rdi, MCTX(.__gregs[REG_RDI]));
#elif HOST_OS == OS_LINUX
#elif defined(__unix__)
bicopy<ToSegfault>(hostctx->pc, MCTX(.gregs[REG_RIP]));
bicopy<ToSegfault>(hostctx->rsp, MCTX(.gregs[REG_RSP]));
bicopy<ToSegfault>(hostctx->r9, MCTX(.gregs[REG_R9]));
@ -100,7 +100,7 @@ static void context_segfault(host_context_t* hostctx, void* segfault_ctx)
bicopy<ToSegfault>(hostctx->r9, MCTX(->__ss.__r9));
bicopy<ToSegfault>(hostctx->rdi, MCTX(->__ss.__rdi));
#else
#error HOST_OS
#error "Unsupported OS"
#endif
#elif HOST_CPU == CPU_MIPS
bicopy<ToSegfault>(hostctx->pc, MCTX(.pc));

View File

@ -346,7 +346,7 @@ void vmem_platform_flush_cache(void *icache_start, void *icache_end, void *dcach
#elif HOST_CPU == CPU_ARM
#if HOST_OS == OS_DARWIN
#if defined(__APPLE__)
#include <libkern/OSCacheControl.h>
static void CacheFlush(void* code, void* pEnd)

View File

@ -1552,7 +1552,7 @@ static void gui_display_settings()
ImGui::Text("Operating System: %s",
#ifdef __ANDROID__
"Android"
#elif HOST_OS == OS_LINUX
#elif defined(__unix__)
"Linux"
#elif defined(__APPLE__)
#ifdef TARGET_IPHONE

View File

@ -57,7 +57,7 @@ void select_directory_popup(const char *prompt, float scaling, StringCallback ca
else
select_current_directory = home;
}
#elif HOST_OS == OS_LINUX || defined(__APPLE__)
#elif defined(__unix__) || defined(__APPLE__)
const char *home = nowide::getenv("HOME");
if (home != NULL)
select_current_directory = home;