From 2eb1876bb89ee5299a7b0f1ff84bbf2f89bba1e1 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 18 Mar 2014 21:22:51 -0400 Subject: [PATCH] add more windows compatibility definitions --- i387/bsd_asm.h | 16 ++++++++++++---- include/cdefs-compat.h | 4 ---- include/types-compat.h | 4 ---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/i387/bsd_asm.h b/i387/bsd_asm.h index 2874b50..29ef51f 100644 --- a/i387/bsd_asm.h +++ b/i387/bsd_asm.h @@ -70,21 +70,29 @@ /* XXX should use .p2align 4,0x90 for -m486. */ -#define _START_ENTRY .text; .p2align 2,0x90 +#define _START_ENTRY .p2align 2,0x90 #if defined(__linux__) || defined(__FreeBSD__) || defined(__ELF__) #define CNAME(csym) csym #define HIDENAME(asmsym) .asmsym -#define _ENTRY(x) _START_ENTRY; \ +#define _ENTRY(x) .text; _START_ENTRY; \ .globl CNAME(x); .type CNAME(x),@function; CNAME(x): #define END(x) .size x, . - x #elif defined(_WIN32) +#ifndef _MSC_VER +#define END(x) .end +#define HEX(Y) 0x#Y +#define _START_ENTRY_WIN .text; _START_ENTRY +#else +#define END(x) end +#define HEX(Y) Y#h +#define _START_ENTRY_WIN .model small; .code; _START_ENTRY +#endif #define CNAME(csym) _##csym #define HIDENAME(asmsym) .asmsym -#define _ENTRY(x) _START_ENTRY; \ +#define _ENTRY(x) _START_ENTRY_WIN; \ .globl CNAME(x); .section .drectve; .ascii " -export:" #x; \ .section .text; .def CNAME(x); .scl 2; .type 32; .endef; CNAME(x): -#define END(x) .end #endif #ifdef PROF diff --git a/include/cdefs-compat.h b/include/cdefs-compat.h index acb6b23..73697bd 100644 --- a/include/cdefs-compat.h +++ b/include/cdefs-compat.h @@ -1,10 +1,6 @@ #ifndef _CDEFS_COMPAT_H_ #define _CDEFS_COMPAT_H_ -#if defined(_MSC_VER) && !defined(_WIN32) - #define _WIN32 -#endif - #ifndef _WIN32 #include "sys/cdefs.h" #else /* _WIN32 */ diff --git a/include/types-compat.h b/include/types-compat.h index 4db07d3..b8c2521 100644 --- a/include/types-compat.h +++ b/include/types-compat.h @@ -1,10 +1,6 @@ #ifndef _TYPES_COMPAT_H_ #define _TYPES_COMPAT_H_ -#if defined(_MSC_VER) && !defined(_WIN32) - #define _WIN32 -#endif - #include #include #include