From 1b002ae0da3b1942fbd135d504296b649f5f0e12 Mon Sep 17 00:00:00 2001 From: scribam Date: Sun, 25 Aug 2019 18:41:42 +0200 Subject: [PATCH] Use __GNUC__ to handle GCC specific code --- core/emitter/x86_op_encoder.h | 2 +- core/hw/arm7/arm7.cpp | 4 ++-- core/oslib/oslib.h | 2 +- core/rec-x86/rec_x86_ngen.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/emitter/x86_op_encoder.h b/core/emitter/x86_op_encoder.h index f2228c40c..e3523a523 100644 --- a/core/emitter/x86_op_encoder.h +++ b/core/emitter/x86_op_encoder.h @@ -60,7 +60,7 @@ #include "build.h" -#if BUILD_COMPILER == COMPILER_GCC +#ifdef __GNUC__ #define __fastcall BALLZZ!! #endif diff --git a/core/hw/arm7/arm7.cpp b/core/hw/arm7/arm7.cpp index 8122f7c31..4406e2f3f 100644 --- a/core/hw/arm7/arm7.cpp +++ b/core/hw/arm7/arm7.cpp @@ -650,7 +650,7 @@ void armv_prof(OpType opt,u32 op,u32 flg); extern "C" void arm_dispatch(); extern "C" void arm_exit(); extern "C" void DYNACALL -#if BUILD_COMPILER == COMPILER_GCC +#ifdef __GNUC__ // Avoid inlining / duplicating / whatever __attribute__ ((optimize(0))) #endif @@ -690,7 +690,7 @@ u32 DYNACALL DoMemOp(u32 addr,u32 data) } //findfirstset -- used in LDM/STM handling -#if HOST_CPU==CPU_X86 && BUILD_COMPILER != COMPILER_GCC +#if HOST_CPU==CPU_X86 && !defined(__GNUC__) #include u32 findfirstset(u32 v) diff --git a/core/oslib/oslib.h b/core/oslib/oslib.h index a44889105..8edd1c4db 100644 --- a/core/oslib/oslib.h +++ b/core/oslib/oslib.h @@ -15,7 +15,7 @@ void WriteSample(s16 right, s16 left); u32 static INLINE bitscanrev(u32 v) { -#if (BUILD_COMPILER==COMPILER_GCC) +#ifdef __GNUC__ return 31-__builtin_clz(v); #else unsigned long rv; diff --git a/core/rec-x86/rec_x86_ngen.h b/core/rec-x86/rec_x86_ngen.h index d68b5fc01..00de0111a 100644 --- a/core/rec-x86/rec_x86_ngen.h +++ b/core/rec-x86/rec_x86_ngen.h @@ -14,7 +14,7 @@ void ngen_opcode(RuntimeBlockInfo* block, shil_opcode* op,x86_block* x86e, bool staging, bool optimise); -#if BUILD_COMPILER == COMPILER_GCC +#ifdef __GNUC__ extern "C" { #endif @@ -29,7 +29,7 @@ void ngen_mainloop(void* cntx); void DYNACALL ngen_blockcheckfail(u32 addr); void DYNACALL ngen_blockcheckfail2(u32 addr); -#if BUILD_COMPILER == COMPILER_GCC +#ifdef __GNUC__ } #endif