From 47722a8c2ebd9575b0111fade551863f972478cc Mon Sep 17 00:00:00 2001 From: Petr Skocik Date: Wed, 12 Jun 2019 15:34:47 +0200 Subject: [PATCH] fix windows errors uncovered by the inline patch By always instantiating extern inlines, the patch has discovered 2 assembly errors, which were fixed in the original mingw64 in 2009. This fixes those errors. Additionally it changes __CRT_INLINE in win32/include/_mingw.h from `extern __inline__` to `static __inline__`. __CRT_INLINE is used exclusively in header files and as such it should not create externally visible instantiations like a `extern inline` would (as per the C standard). --- win32/include/_mingw.h | 2 +- win32/include/winapi/winnt.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/win32/include/_mingw.h b/win32/include/_mingw.h index 2fc97987..4511d66c 100644 --- a/win32/include/_mingw.h +++ b/win32/include/_mingw.h @@ -51,7 +51,7 @@ #define __GNUC_VA_LIST #define _CRTIMP extern -#define __CRT_INLINE extern __inline__ +#define __CRT_INLINE static __inline__ #define _CRT_ALIGN(x) __attribute__((aligned(x))) #define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) diff --git a/win32/include/winapi/winnt.h b/win32/include/winapi/winnt.h index 4cf685d2..bf5d1270 100644 --- a/win32/include/winapi/winnt.h +++ b/win32/include/winapi/winnt.h @@ -1474,7 +1474,7 @@ typedef DWORD LCID; #if(defined(_X86_) && !defined(__x86_64)) __CRT_INLINE VOID MemoryBarrier(VOID) { LONG Barrier; - __asm__ __volatile__("xchgl %eax,%0 " + __asm__ __volatile__("xchgl %%eax,%0 " :"=r" (Barrier)); } #define YieldProcessor() __asm__ __volatile__("rep nop "); @@ -1486,7 +1486,7 @@ typedef DWORD LCID; #define PF_NON_TEMPORAL_LEVEL_ALL __CRT_INLINE VOID DbgRaiseAssertionFailure(void) { - __asm__ __volatile__("int 0x2c "); + __asm__ __volatile__("int $0x2c "); } PVOID GetCurrentFiber(void); __CRT_INLINE PVOID GetCurrentFiber(void)