mirror of
https://github.com/86Box/86Box.git
synced 2026-02-21 17:15:32 -07:00
Remove all non-library _MSC_VER checks
This commit is contained in:
@@ -192,11 +192,7 @@ codegen_allocator_clean_blocks(UNUSED(struct mem_block_t *block))
|
||||
{
|
||||
#if defined __ARM_EABI__ || defined __aarch64__ || defined _M_ARM64
|
||||
while (1) {
|
||||
# ifndef _MSC_VER
|
||||
__clear_cache(&mem_block_alloc[block->offset], &mem_block_alloc[block->offset + MEM_BLOCK_SIZE]);
|
||||
# else
|
||||
FlushInstructionCache(GetCurrentProcess(), &mem_block_alloc[block->offset], MEM_BLOCK_SIZE);
|
||||
# endif
|
||||
if (block->next)
|
||||
block = &mem_blocks[block->next - 1];
|
||||
else
|
||||
|
||||
@@ -446,16 +446,14 @@ typedef struct {
|
||||
# define CPU_STATUS_MASK 0xffff0000
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define COMPILE_TIME_ASSERT(expr) /*nada*/
|
||||
|
||||
#ifdef EXTREME_DEBUG
|
||||
# define COMPILE_TIME_ASSERT(expr) typedef char COMP_TIME_ASSERT[(expr) ? 1 : 0];
|
||||
#else
|
||||
# ifdef EXTREME_DEBUG
|
||||
# define COMPILE_TIME_ASSERT(expr) typedef char COMP_TIME_ASSERT[(expr) ? 1 : 0];
|
||||
# else
|
||||
# define COMPILE_TIME_ASSERT(expr) /*nada*/
|
||||
# endif
|
||||
# define COMPILE_TIME_ASSERT(expr) /*nada*/
|
||||
#endif
|
||||
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(cpu_state_t) <= 128)
|
||||
|
||||
#define cpu_state_offset(MEMBER) ((uint8_t) ((uintptr_t) &cpu_state.MEMBER - (uintptr_t) &cpu_state - 128))
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
#endif
|
||||
|
||||
#include "x87_timings.h"
|
||||
#ifdef _MSC_VER
|
||||
# include <intrin.h>
|
||||
#endif
|
||||
#include "x87_ops_conv.h"
|
||||
|
||||
#ifdef ENABLE_FPU_LOG
|
||||
@@ -390,8 +387,7 @@ x87_compare(double a, double b)
|
||||
if ((fpu_type < FPU_287XL) && !(cpu_state.npxc & 0x1000) && ((a == INFINITY) || (a == -INFINITY)) && ((b == INFINITY) || (b == -INFINITY)))
|
||||
eb = ea;
|
||||
|
||||
# if !defined(_MSC_VER) || defined(__clang__)
|
||||
/* Memory barrier, to force GCC to write to the input parameters
|
||||
/* Memory barrier, to force GCC to write to the input parameters
|
||||
* before the compare rather than after */
|
||||
__asm volatile(""
|
||||
:
|
||||
@@ -406,17 +402,7 @@ x87_compare(double a, double b)
|
||||
"fnstsw %0\n"
|
||||
: "=m"(result)
|
||||
: "m"(ea), "m"(eb));
|
||||
# else
|
||||
_ReadWriteBarrier();
|
||||
_asm
|
||||
{
|
||||
fld eb
|
||||
fld ea
|
||||
fclex
|
||||
fcompp
|
||||
fnstsw result
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
return result & (FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3);
|
||||
#else
|
||||
@@ -451,7 +437,6 @@ x87_ucompare(double a, double b)
|
||||
#ifdef X87_INLINE_ASM
|
||||
uint32_t result;
|
||||
|
||||
# if !defined(_MSC_VER) || defined(__clang__)
|
||||
/* Memory barrier, to force GCC to write to the input parameters
|
||||
* before the compare rather than after */
|
||||
__asm volatile(""
|
||||
@@ -467,17 +452,6 @@ x87_ucompare(double a, double b)
|
||||
"fnstsw %0\n"
|
||||
: "=m"(result)
|
||||
: "m"(a), "m"(b));
|
||||
# else
|
||||
_ReadWriteBarrier();
|
||||
_asm
|
||||
{
|
||||
fld b
|
||||
fld a
|
||||
fclex
|
||||
fcompp
|
||||
fnstsw result
|
||||
}
|
||||
# endif
|
||||
|
||||
return result & (FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3);
|
||||
#else
|
||||
|
||||
@@ -18,11 +18,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#ifndef _MSC_VER
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/timer.h>
|
||||
|
||||
@@ -69,19 +69,10 @@ extern int strnicmp(const char *s1, const char *s2, size_t n);
|
||||
# define fseeko64 fseeko
|
||||
# define ftello64 ftello
|
||||
# define off64_t off_t
|
||||
#elif defined(_MSC_VER)
|
||||
// # define fopen64 fopen
|
||||
# define fseeko64 _fseeki64
|
||||
# define ftello64 _ftelli64
|
||||
# define off64_t off_t
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define UNUSED(arg) arg
|
||||
#else
|
||||
/* A hack (GCC-specific?) to allow us to ignore unused parameters. */
|
||||
# define UNUSED(arg) __attribute__((unused)) arg
|
||||
#endif
|
||||
|
||||
/* Return the size (in wchar's) of a wchar_t array. */
|
||||
#define sizeof_w(x) (sizeof((x)) / sizeof(wchar_t))
|
||||
@@ -97,17 +88,14 @@ extern "C" {
|
||||
# define atomic_flag_t atomic_flag
|
||||
# define atomic_bool_t atomic_bool
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
|
||||
#if __has_attribute(fallthrough)
|
||||
# define fallthrough __attribute__((fallthrough))
|
||||
#else
|
||||
# if __has_attribute(fallthrough)
|
||||
# define fallthrough __attribute__((fallthrough))
|
||||
# else
|
||||
# if __has_attribute(__fallthrough__)
|
||||
# define fallthrough __attribute__((__fallthrough__))
|
||||
# endif
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
# if __has_attribute(__fallthrough__)
|
||||
# define fallthrough __attribute__((__fallthrough__))
|
||||
# endif
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -16,18 +16,16 @@
|
||||
#define EMU_PLAT_FALLTHROUGH_H
|
||||
|
||||
#ifndef EMU_PLAT_H
|
||||
#ifdef _MSC_VER
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
|
||||
#if __has_attribute(fallthrough)
|
||||
# define fallthrough __attribute__((fallthrough))
|
||||
#else
|
||||
# if __has_attribute(fallthrough)
|
||||
# define fallthrough __attribute__((fallthrough))
|
||||
# else
|
||||
# if __has_attribute(__fallthrough__)
|
||||
# define fallthrough __attribute__((__fallthrough__))
|
||||
# endif
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
# if __has_attribute(__fallthrough__)
|
||||
# define fallthrough __attribute__((__fallthrough__))
|
||||
# endif
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /*EMU_PLAT_FALLTHROUGH_H*/
|
||||
|
||||
@@ -19,12 +19,9 @@
|
||||
#define EMU_PLAT_UNUSED_H
|
||||
|
||||
#ifndef EMU_PLAT_H
|
||||
#ifdef _MSC_VER
|
||||
# define UNUSED(arg) arg
|
||||
#else
|
||||
/* A hack (GCC-specific?) to allow us to ignore unused parameters. */
|
||||
|
||||
# define UNUSED(arg) __attribute__((unused)) arg
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /*EMU_PLAT_UNUSED_H*/
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
#ifndef VIDEO_VOODOO_CODEGEN_X86_64_H
|
||||
#define VIDEO_VOODOO_CODEGEN_X86_64_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include <intrin.h>
|
||||
#else
|
||||
# include <xmmintrin.h>
|
||||
#endif
|
||||
#include <xmmintrin.h>
|
||||
|
||||
#define BLOCK_NUM 8
|
||||
#define BLOCK_MASK (BLOCK_NUM - 1)
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
#ifndef VIDEO_VOODOO_CODEGEN_X86_H
|
||||
#define VIDEO_VOODOO_CODEGEN_X86_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include <intrin.h>
|
||||
#else
|
||||
# include <xmmintrin.h>
|
||||
#endif
|
||||
#include <xmmintrin.h>
|
||||
|
||||
#define BLOCK_NUM 8
|
||||
#define BLOCK_MASK (BLOCK_NUM - 1)
|
||||
|
||||
@@ -52,9 +52,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <time.h>
|
||||
#ifndef _MSC_VER
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <stdbool.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
|
||||
@@ -51,16 +51,10 @@ rdtsc(void)
|
||||
#if defined(__x86_64__)
|
||||
unsigned int hi;
|
||||
unsigned int lo;
|
||||
# ifdef _MSC_VER
|
||||
__asm {
|
||||
rdtsc
|
||||
mov hi, edx ; EDX:EAX is already standard return!!
|
||||
mov lo, eax
|
||||
}
|
||||
# else
|
||||
|
||||
__asm__ __volatile__("rdtsc"
|
||||
: "=a"(lo), "=d"(hi));
|
||||
# endif
|
||||
|
||||
return ((unsigned long long) lo) | (((unsigned long long) hi) << 32);
|
||||
#else
|
||||
return time(NULL);
|
||||
|
||||
Reference in New Issue
Block a user