Commit d9940ad7 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

winrt: Rework patch application & update patchset

parent 95a31468
......@@ -12,15 +12,11 @@ ENV TOOLCHAIN_PREFIX=/opt/gcc-$TARGET_TUPLE
ENV MINGW_PREFIX=$TOOLCHAIN_PREFIX/$TARGET_TUPLE
ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH
COPY missing-snprintf.patch .
#COPY winstorecompat.patch .
COPY windowsapp.a.patch .
COPY getstartupinfo.patch .
COPY switchtothread.patch .
COPY patches /build/patches
ENV GCC_VERSION=5.4.0
RUN mkdir /build && cd /build && \
RUN cd /build && \
mkdir $TOOLCHAIN_PREFIX && \
mkdir $MINGW_PREFIX && \
ln -s $MINGW_PREFIX $TOOLCHAIN_PREFIX/mingw && \
......@@ -34,8 +30,8 @@ RUN mkdir /build && cd /build && \
cd binutils-2.26 && mkdir build && cd build && \
../configure --prefix=$TOOLCHAIN_PREFIX --target=$TARGET_TUPLE \
--disable-werror --disable-multilib && make -j4 && make install && \
cd /build/mingw-w64 && git am /build/patches/*.patch && \
cd /build/mingw-w64/mingw-w64-headers && mkdir build && cd build && \
git am /switchtothread.patch && \
../configure --prefix=$MINGW_PREFIX \
--host=$TARGET_TUPLE && make install && \
cd /build && \
......@@ -57,9 +53,6 @@ RUN mkdir /build && cd /build && \
make -j4 all-gcc && \
make install-gcc && \
cd /build/mingw-w64/mingw-w64-crt && \
git am ../../../missing-snprintf.patch && \
git am ../../../windowsapp.a.patch && \
git am ../../../getstartupinfo.patch && \
mkdir build && cd build && \
../configure --prefix=$MINGW_PREFIX \
--host=$TARGET_TUPLE && \
......@@ -79,4 +72,4 @@ RUN mkdir /build && cd /build && \
../configure --prefix=$TOOLCHAIN_PREFIX --target=$TARGET_TUPLE && \
make -j4 && \
make install && \
cd / && rm -rf /build && rm -f /*.patch
cd / && rm -rf /build
From 65b26e230dff7c58c38cb9a42f6f963fbc252ee9 Mon Sep 17 00:00:00 2001
From 31eb1cd55bb3d47449860e9b9d0e6d18926b0377 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Thu, 21 Apr 2016 16:07:59 +0200
Subject: [PATCH] UGLY HACK: Don't use Rtl* function on win64 when building for
winrt
Subject: [PATCH 1/9] UGLY HACK: Don't use Rtl* function on win64 when building
for winrt
---
mingw-w64-crt/crt/crt_handler.c | 2 +-
......@@ -51,10 +51,10 @@ index ae37e0f..3be64bb 100644
#endif
_set_invalid_parameter_handler (__mingw_invalidParameterHandler);
diff --git a/mingw-w64-crt/crt/gs_support.c b/mingw-w64-crt/crt/gs_support.c
index dbd95d5..4207fff 100644
index c5c1773..51d2d1a 100644
--- a/mingw-w64-crt/crt/gs_support.c
+++ b/mingw-w64-crt/crt/gs_support.c
@@ -103,7 +103,7 @@ __declspec(noreturn) void __cdecl
@@ -104,7 +104,7 @@ __declspec(noreturn) void __cdecl
__report_gsfailure (ULONG_PTR StackCookie)
{
volatile UINT_PTR cookie[2] __MINGW_ATTRIB_UNUSED;
......@@ -64,5 +64,5 @@ index dbd95d5..4207fff 100644
PRUNTIME_FUNCTION fctEntry;
PVOID hndData;
--
2.8.0.rc3
2.9.3
From 44ad7738b988b86cddc7b171af160c9397cf2b33 Mon Sep 17 00:00:00 2001
From 52944716641824d4dcd1460540ceb821491c9551 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Fri, 29 Apr 2016 11:07:45 +0200
Subject: [PATCH 4/5] crt: Add missing snprintf aliases
Subject: [PATCH 2/9] crt: Add missing snprintf aliases
---
mingw-w64-crt/lib32/msvcr120_app.def.in | 1 +
......@@ -33,5 +33,5 @@ index 53b2f7b..b829b84 100644
_vsnprintf_c_l
_vsnprintf_l
--
2.8.1
2.9.3
From d84ee325df2d06b58a16a30eb5042e0a115f122b Mon Sep 17 00:00:00 2001
From edb151a6826c67c96db73146a54458071fd21152 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Tue, 2 Aug 2016 10:36:26 +0200
Subject: [PATCH 1/2] crt: Add a WindowsApp.lib mri & associated def files
Subject: [PATCH 3/9] crt: Add a WindowsApp.lib mri & associated def files
This is required to have an application running on Xbox1, as it won't
contain kernel32.dll, thus the symbols have to be looked for into other
......@@ -273,10 +273,10 @@ locations
create mode 100644 mingw-w64-crt/lib64/windowsapp.mri
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 7804663..02d8035 100644
index e727e64..44360db 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -647,6 +647,33 @@ lib32/libsynchronization.a: lib32/synchronization.mri lib32/libapi-ms-win-core-s
@@ -635,6 +635,33 @@ lib32/libsynchronization.a: lib32/synchronization.mri lib32/libapi-ms-win-core-s
$(AR) -M < $<
$(RANLIB) $@
......@@ -310,7 +310,7 @@ index 7804663..02d8035 100644
dx32_DATA =
dx32_DATA += lib32/libxinput.a
dx32_DATA += lib32/libxapofx.a
@@ -1151,7 +1178,8 @@ lib64_DATA = \
@@ -1138,7 +1165,8 @@ lib64_DATA = \
lib64/libd3d11.a lib64/libd3dcompiler_47.a \
lib64/libwinhttp.a \
lib64/libruntimeobject.a \
......@@ -320,7 +320,7 @@ index 7804663..02d8035 100644
if !W32API
lib64_DATA += lib64/libmsvcp60.a lib64/libmsvcr80.a lib64/libmsvcr90.a lib64/libmsvcr100.a lib64/libmsvcr90d.a \
@@ -1184,6 +1212,33 @@ lib64/libsynchronization.a: lib64/synchronization.mri lib64/libapi-ms-win-core-s
@@ -1171,6 +1199,33 @@ lib64/libsynchronization.a: lib64/synchronization.mri lib64/libapi-ms-win-core-s
$(AR) -M < $<
$(RANLIB) $@
......@@ -355,7 +355,7 @@ index 7804663..02d8035 100644
dx64_DATA += lib64/libxinput.a
dx64_DATA += lib64/libxapofx.a
diff --git a/mingw-w64-crt/Makefile.in b/mingw-w64-crt/Makefile.in
index c97401f..ff6d247 100644
index 22bbae9..890434b 100644
--- a/mingw-w64-crt/Makefile.in
+++ b/mingw-w64-crt/Makefile.in
@@ -198,8 +198,10 @@ host_triplet = @host@
......@@ -371,7 +371,7 @@ index c97401f..ff6d247 100644
@ENABLE_TESTS_UNICODE_TRUE@am__append_14 = testcases/t_municode testcases/t_tmain
check_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_4) $(am__EXEEXT_6)
TESTS = $(am__EXEEXT_2) $(am__EXEEXT_4) $(am__EXEEXT_6)
@@ -5764,7 +5766,7 @@ src_intrincsarm32 =
@@ -5727,7 +5729,7 @@ src_intrincsarm32 =
@LIB32_TRUE@ lib32/libxaudio2_8.a lib32/libxinput1_1.a \
@LIB32_TRUE@ lib32/libxinput1_2.a lib32/libxinput1_3.a \
@LIB32_TRUE@ lib32/libxinput1_4.a lib32/libxinput9_1_0.a \
......@@ -380,7 +380,7 @@ index c97401f..ff6d247 100644
@LIB32_TRUE@dx32_DATA = lib32/libxinput.a lib32/libxapofx.a \
@LIB32_TRUE@ lib32/libx3daudio.a lib32/libd3dx9.a \
@LIB32_TRUE@ lib32/libd3dx10.a lib32/libd3dx11.a \
@@ -6495,7 +6497,8 @@ src_intrincsarm32 =
@@ -6457,7 +6459,8 @@ src_intrincsarm32 =
@LIB64_TRUE@ lib64/libd3dcsx_46.a lib64/libd3d11.a \
@LIB64_TRUE@ lib64/libd3dcompiler_47.a lib64/libwinhttp.a \
@LIB64_TRUE@ lib64/libruntimeobject.a \
......@@ -390,7 +390,7 @@ index c97401f..ff6d247 100644
@LIB64_TRUE@dx64_DATA = lib64/libxinput.a lib64/libxapofx.a \
@LIB64_TRUE@ lib64/libx3daudio.a lib64/libd3dx9.a \
@LIB64_TRUE@ lib64/libd3dx10.a lib64/libd3dx11.a \
@@ -49311,6 +49314,33 @@ lib64/DFP_src_%.dfp.obj: math/DFP/mpdecimal/libmpdec/%.c
@@ -49200,6 +49203,33 @@ _libm_dummy.c:
@LIB32_TRUE@ $(AR) -M < $<
@LIB32_TRUE@ $(RANLIB) $@
......@@ -424,7 +424,7 @@ index c97401f..ff6d247 100644
@LIB32_TRUE@lib32/libxinput.a: lib32/$(xinput).def
@LIB32_TRUE@ $(DTDEF32) $<
@LIB32_TRUE@lib32/libxapofx.a: lib32/$(xapofx).def
@@ -49375,6 +49405,33 @@ lib64/DFP_src_%.dfp.obj: math/DFP/mpdecimal/libmpdec/%.c
@@ -49264,6 +49294,33 @@ _libm_dummy.c:
@LIB64_TRUE@ $(AR) -M < $<
@LIB64_TRUE@ $(RANLIB) $@
......@@ -3048,5 +3048,5 @@ index 0000000..148483f
+SAVE
+END
--
2.8.1
2.9.3
From 6ab38488dcaf853b616ee636a4714cedff33e1c9 Mon Sep 17 00:00:00 2001
From fa610ea3dd1bf3cf3505e51420eb0ff741a41fd0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Tue, 2 Aug 2016 10:47:13 +0200
Subject: [PATCH 2/2] winstorecompat: Add a GetStartupInfo stub
Subject: [PATCH 4/9] winstorecompat: Add a GetStartupInfo stub
This is required for configure test executables to link when building
with windowsapp.lib
---
mingw-w64-libraries/winstorecompat/Makefile.am | 1 +
.../winstorecompat/src/GetStartupInfo.c | 40 ++++++++++++++++++++++
2 files changed, 41 insertions(+)
.../winstorecompat/src/GetStartupInfo.c | 44 ++++++++++++++++++++++
2 files changed, 45 insertions(+)
create mode 100644 mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c
diff --git a/mingw-w64-libraries/winstorecompat/Makefile.am b/mingw-w64-libraries/winstorecompat/Makefile.am
......@@ -23,10 +23,10 @@ index 332cae5..81512ce 100644
$(NULL)
diff --git a/mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c b/mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c
new file mode 100644
index 0000000..110099d
index 0000000..9094ade
--- /dev/null
+++ b/mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c
@@ -0,0 +1,40 @@
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 2016 mingw-w64 project
+
......@@ -54,10 +54,14 @@ index 0000000..110099d
+#define GetStartupInfo __GetStartupInfo
+#include <windows.h>
+#undef GetStartupInfo
+#include <assert.h>
+
+VOID WINAPI GetStartupInfo( LPSTARTUPINFO lpStartupInfo )
+{
+ (void)lpStartupInfo;
+ // This stub is provided solely to allow configure to compile a test program
+ // linking with libwindowsapp.a
+ // There is no reason for a winstore application to call this function
+ assert(0);
+}
+
+#ifndef _WIN64
......@@ -68,5 +72,5 @@ index 0000000..110099d
+VOID (WINAPI *__MINGW_IMP_SYMBOL(GetStartupInfoW))(LPSTARTUPINFO) asm("__imp_GetStartupInfoW") = GetStartupInfo;
+#endif
--
2.8.1
2.9.3
From a1cbf19c2d0e9a74ae3efc5746cdbc223ead2d42 Mon Sep 17 00:00:00 2001
From ca83683b9e8072a6f2774415f7fd3d22c5cb9a3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Wed, 24 Aug 2016 11:13:03 +0200
Subject: [PATCH] include: SwitchToThread is always available on Win10
Subject: [PATCH 5/9] include: SwitchToThread is always available on Win10
---
mingw-w64-headers/include/processthreadsapi.h | 1 +
......
From 1ee0c9868f1c1a1c45de4cf80eee2881507ab37e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Tue, 6 Sep 2016 16:06:12 +0200
Subject: [PATCH 6/9] winstorecompat: Add GetConsoleOutputCP replacement
---
mingw-w64-headers/include/wincon.h | 4 +++
mingw-w64-libraries/winstorecompat/Makefile.am | 1 +
.../winstorecompat/src/GetConsoleOutputCP.c | 38 ++++++++++++++++++++++
3 files changed, 43 insertions(+)
create mode 100644 mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c
diff --git a/mingw-w64-headers/include/wincon.h b/mingw-w64-headers/include/wincon.h
index 2993313..e239f1f 100644
--- a/mingw-w64-headers/include/wincon.h
+++ b/mingw-w64-headers/include/wincon.h
@@ -375,6 +375,10 @@ WINBASEAPI WINBOOL WINAPI SetCurrentConsoleFontEx(
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && defined(WINSTORECOMPAT)
+WINBASEAPI UINT WINAPI GetConsoleOutputCP(VOID);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/mingw-w64-libraries/winstorecompat/Makefile.am b/mingw-w64-libraries/winstorecompat/Makefile.am
index 81512ce..ac69bb7 100644
--- a/mingw-w64-libraries/winstorecompat/Makefile.am
+++ b/mingw-w64-libraries/winstorecompat/Makefile.am
@@ -37,4 +37,5 @@ libwinstorecompat_a_SOURCES = \
src/QueueTimer.c \
src/Crypto.c \
src/GetStartupInfo.c \
+ src/GetConsoleOutputCP.c \
$(NULL)
diff --git a/mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c b/mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c
new file mode 100644
index 0000000..4e60ec2
--- /dev/null
+++ b/mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c
@@ -0,0 +1,38 @@
+/*
+ Copyright (c) 2013-2016 mingw-w64 project
+
+ Contributing authors: Hugo Beauzée-Luyssen
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#define GetConsoleOutputCP __GetConsoleOutputCP
+#include <windows.h>
+#undef GetConsoleOutputCP
+
+UINT GetConsoleOutputCP(void)
+{
+ return CP_UTF8;
+}
+
+#ifndef _WIN64
+UINT (*__MINGW_IMP_SYMBOL(GetConsoleOutputCP))(void) asm("__imp__GetConsoleOutputCP") = GetConsoleOutputCP;
+#else
+UINT (*__MINGW_IMP_SYMBOL(GetConsoleOutputCP))(void) asm("__imp_GetConsoleOutputCP") = GetConsoleOutputCP;
+#endif
--
2.9.3
From ee2e5cb0baa853e2bbcbcbc81c07128d2e4c2c61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Thu, 22 Sep 2016 18:11:38 +0200
Subject: [PATCH 7/9] winstorecompat: Fix mangling header guard.
Symbols are only mangled on i686, while the old check was causing arm
symbols to be mangled as well
---
mingw-w64-libraries/winstorecompat/src/CreateEventW.c | 2 +-
mingw-w64-libraries/winstorecompat/src/CreateFileW.c | 2 +-
mingw-w64-libraries/winstorecompat/src/CreateMutexW.c | 2 +-
mingw-w64-libraries/winstorecompat/src/CreateSemaphoreW.c | 4 ++--
mingw-w64-libraries/winstorecompat/src/Crypto.c | 2 +-
mingw-w64-libraries/winstorecompat/src/GetACP.c | 2 +-
mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c | 2 +-
mingw-w64-libraries/winstorecompat/src/GetFileAttributes.c | 2 +-
mingw-w64-libraries/winstorecompat/src/GetFileSize.c | 2 +-
mingw-w64-libraries/winstorecompat/src/GetModuleHandle.c | 2 +-
mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c | 2 +-
mingw-w64-libraries/winstorecompat/src/GetTickCount.c | 2 +-
mingw-w64-libraries/winstorecompat/src/InitializeCriticalSection.c | 2 +-
mingw-w64-libraries/winstorecompat/src/IsDBCSLeadByteEx.c | 2 +-
mingw-w64-libraries/winstorecompat/src/LoadLibraryW.c | 2 +-
mingw-w64-libraries/winstorecompat/src/LocalAlloc.c | 2 +-
mingw-w64-libraries/winstorecompat/src/LocalFree.c | 2 +-
mingw-w64-libraries/winstorecompat/src/QueueTimer.c | 2 +-
mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c | 2 +-
mingw-w64-libraries/winstorecompat/src/SetErrorMode.c | 2 +-
mingw-w64-libraries/winstorecompat/src/SetFilePointer.c | 2 +-
mingw-w64-libraries/winstorecompat/src/SetUnhandledExceptionFilter.c | 2 +-
mingw-w64-libraries/winstorecompat/src/Sleep.c | 2 +-
mingw-w64-libraries/winstorecompat/src/SleepEx.c | 2 +-
mingw-w64-libraries/winstorecompat/src/TerminateProcess.c | 2 +-
mingw-w64-libraries/winstorecompat/src/Tls.c | 2 +-
mingw-w64-libraries/winstorecompat/src/UnhandledExceptionFilter.c | 2 +-
mingw-w64-libraries/winstorecompat/src/VirtualProtect.c | 2 +-
mingw-w64-libraries/winstorecompat/src/WaitForSingleObject.c | 2 +-
mingw-w64-libraries/winstorecompat/src/beginthread.c | 2 +-
mingw-w64-libraries/winstorecompat/src/getenv.c | 2 +-
mingw-w64-libraries/winstorecompat/src/getpid.c | 2 +-
32 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/mingw-w64-libraries/winstorecompat/src/CreateEventW.c b/mingw-w64-libraries/winstorecompat/src/CreateEventW.c
index 623898c..a313999 100644
--- a/mingw-w64-libraries/winstorecompat/src/CreateEventW.c
+++ b/mingw-w64-libraries/winstorecompat/src/CreateEventW.c
@@ -39,7 +39,7 @@ HANDLE WINAPI CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManual
return CreateEventExW(lpEventAttributes, lpName, flags, EVENT_ALL_ACCESS);
}
-#ifndef _WIN64
+#ifdef _X86_
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateEventW))(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCWSTR lpName) asm("__imp__CreateEventW@16") = CreateEventW;
#else
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateEventW))(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCWSTR lpName) asm("__imp_CreateEventW") = CreateEventW;
diff --git a/mingw-w64-libraries/winstorecompat/src/CreateFileW.c b/mingw-w64-libraries/winstorecompat/src/CreateFileW.c
index d025500..9ff0dcf 100644
--- a/mingw-w64-libraries/winstorecompat/src/CreateFileW.c
+++ b/mingw-w64-libraries/winstorecompat/src/CreateFileW.c
@@ -47,7 +47,7 @@ HANDLE WINAPI CreateFileW(LPCWSTR lpFileName,
return CreateFile2(lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, &createExParams);
}
-#ifndef _WIN64
+#ifdef _X86_
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateFileW))(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) asm("__imp__CreateFileW@28") = CreateFileW;
#else
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateFileW))(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) asm("__imp_CreateFileW") = CreateFileW;
diff --git a/mingw-w64-libraries/winstorecompat/src/CreateMutexW.c b/mingw-w64-libraries/winstorecompat/src/CreateMutexW.c
index 30a3df8..0dc1f7b 100644
--- a/mingw-w64-libraries/winstorecompat/src/CreateMutexW.c
+++ b/mingw-w64-libraries/winstorecompat/src/CreateMutexW.c
@@ -37,7 +37,7 @@ HANDLE WINAPI CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitia
return CreateMutexExW(lpMutexAttributes, lpName, flags, EVENT_ALL_ACCESS);
}
-#ifndef _WIN64
+#ifdef _X86_
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateMutexW))(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR lpName) asm("__imp__CreateMutexW@12") = CreateMutexW;
#else
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateMutexW))(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR lpName) asm("__imp_CreateMutexW") = CreateMutexW;
diff --git a/mingw-w64-libraries/winstorecompat/src/CreateSemaphoreW.c b/mingw-w64-libraries/winstorecompat/src/CreateSemaphoreW.c
index 1f92fce..9289bd8 100644
--- a/mingw-w64-libraries/winstorecompat/src/CreateSemaphoreW.c
+++ b/mingw-w64-libraries/winstorecompat/src/CreateSemaphoreW.c
@@ -39,7 +39,7 @@ HANDLE WINAPI CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
return CreateSemaphoreExW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName, 0, EVENT_ALL_ACCESS);
}
-#ifndef _WIN64
+#ifdef _X86_
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateSemaphoreW))(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName) asm("__imp__CreateSemaphoreW@16") = CreateSemaphoreW;
#else
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateSemaphoreW))(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName) asm("__imp_CreateSemaphoreW") = CreateSemaphoreW;
@@ -64,7 +64,7 @@ HANDLE WINAPI CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
return CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpwName );
}
-#ifndef _WIN64
+#ifdef _X86_
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateSemaphoreA))(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName) asm("__imp__CreateSemaphoreA@16") = CreateSemaphoreA;
#else
HANDLE (WINAPI *__MINGW_IMP_SYMBOL(CreateSemaphoreA))(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName) asm("__imp_CreateSemaphoreA") = CreateSemaphoreA;
diff --git a/mingw-w64-libraries/winstorecompat/src/Crypto.c b/mingw-w64-libraries/winstorecompat/src/Crypto.c
index 4d58e9e..028a4dc 100644
--- a/mingw-w64-libraries/winstorecompat/src/Crypto.c
+++ b/mingw-w64-libraries/winstorecompat/src/Crypto.c
@@ -100,7 +100,7 @@ BOOL WINAPI CryptGenRandom(HCRYPTPROV phProv, DWORD dwLen, BYTE *pbBuffer)
return TRUE;
}
-#ifndef _WIN64
+#ifdef _X86_
BOOL (WINAPI *__MINGW_IMP_SYMBOL(CryptAcquireContextW))(HCRYPTPROV*, LPCTSTR, LPCTSTR, DWORD, DWORD) asm("__imp__CryptAcquireContextW@20") = CryptAcquireContextW;
BOOL (WINAPI *__MINGW_IMP_SYMBOL(CryptAcquireContextA))(HCRYPTPROV*, LPCTSTR, LPCTSTR, DWORD, DWORD) asm("__imp__CryptAcquireContextA@20") = CryptAcquireContextA;
BOOL (WINAPI *__MINGW_IMP_SYMBOL(CryptReleaseContext))(HCRYPTPROV, DWORD) asm("__imp__CryptReleaseContext@8") = CryptReleaseContext;
diff --git a/mingw-w64-libraries/winstorecompat/src/GetACP.c b/mingw-w64-libraries/winstorecompat/src/GetACP.c
index 2cefa5f..5f480c6 100644
--- a/mingw-w64-libraries/winstorecompat/src/GetACP.c
+++ b/mingw-w64-libraries/winstorecompat/src/GetACP.c
@@ -34,7 +34,7 @@ UINT WINAPI GetACP(void)
return CP_UTF8; /* utf-8 */
}
-#ifndef _WIN64
+#ifdef _X86_
UINT (WINAPI *__MINGW_IMP_SYMBOL(GetACP))(void) asm("__imp__GetACP@0") = GetACP;
#else
UINT (WINAPI *__MINGW_IMP_SYMBOL(GetACP))(void) asm("__imp_GetACP") = GetACP;
diff --git a/mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c b/mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c
index 4e60ec2..308e6c5 100644
--- a/mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c
+++ b/mingw-w64-libraries/winstorecompat/src/GetConsoleOutputCP.c
@@ -31,7 +31,7 @@ UINT GetConsoleOutputCP(void)
return CP_UTF8;
}
-#ifndef _WIN64
+#ifdef _X86_
UINT (*__MINGW_IMP_SYMBOL(GetConsoleOutputCP))(void) asm("__imp__GetConsoleOutputCP") = GetConsoleOutputCP;
#else
UINT (*__MINGW_IMP_SYMBOL(GetConsoleOutputCP))(void) asm("__imp_GetConsoleOutputCP") = GetConsoleOutputCP;
diff --git a/mingw-w64-libraries/winstorecompat/src/GetFileAttributes.c b/mingw-w64-libraries/winstorecompat/src/GetFileAttributes.c
index a8fb915..c7b21d0 100644
--- a/mingw-w64-libraries/winstorecompat/src/GetFileAttributes.c
+++ b/mingw-w64-libraries/winstorecompat/src/GetFileAttributes.c
@@ -41,7 +41,7 @@ DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
return INVALID_FILE_ATTRIBUTES;
}
-#ifndef _WIN64
+#ifdef _X86_
DWORD (WINAPI *__MINGW_IMP_SYMBOL(GetFileAttributesW))(LPCWSTR lpFileName) asm("__imp__GetFileAttributesW@4") = GetFileAttributesW;
#else
DWORD (WINAPI *__MINGW_IMP_SYMBOL(GetFileAttributesW))(LPCWSTR lpFileName) asm("__imp_GetFileAttributesW") = GetFileAttributesW;
diff --git a/mingw-w64-libraries/winstorecompat/src/GetFileSize.c b/mingw-w64-libraries/winstorecompat/src/GetFileSize.c
index 3e81918..a503999 100644
--- a/mingw-w64-libraries/winstorecompat/src/GetFileSize.c
+++ b/mingw-w64-libraries/winstorecompat/src/GetFileSize.c
@@ -48,7 +48,7 @@ DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
return dwRet;
}
-#ifndef _WIN64
+#ifdef _X86_
DWORD (WINAPI *__MINGW_IMP_SYMBOL(GetFileSize))(HANDLE hFile, LPDWORD lpFileSizeHigh) asm("__imp__GetFileSize@8") = GetFileSize;
#else
DWORD (WINAPI *__MINGW_IMP_SYMBOL(GetFileSize))(HANDLE hFile, LPDWORD lpFileSizeHigh) asm("__imp_GetFileSize") = GetFileSize;
diff --git a/mingw-w64-libraries/winstorecompat/src/GetModuleHandle.c b/mingw-w64-libraries/winstorecompat/src/GetModuleHandle.c
index 7de9005..412ed04 100644
--- a/mingw-w64-libraries/winstorecompat/src/GetModuleHandle.c
+++ b/mingw-w64-libraries/winstorecompat/src/GetModuleHandle.c
@@ -56,7 +56,7 @@ HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
return NULL;
}
-#ifndef _WIN64
+#ifdef _X86_
HMODULE (WINAPI *__MINGW_IMP_SYMBOL(GetModuleHandleA))(LPCSTR) asm("__imp__GetModuleHandleA@4") = GetModuleHandleA;
HMODULE (WINAPI *__MINGW_IMP_SYMBOL(GetModuleHandleW))(LPCWSTR) asm("__imp__GetModuleHandleW@4") = GetModuleHandleW;
#else
diff --git a/mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c b/mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c
index 9094ade..9d7d159 100644
--- a/mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c
+++ b/mingw-w64-libraries/winstorecompat/src/GetStartupInfo.c
@@ -35,7 +35,7 @@ VOID WINAPI GetStartupInfo( LPSTARTUPINFO lpStartupInfo )
assert(0);
}
-#ifndef _WIN64
+#ifdef _X86_
VOID (WINAPI *__MINGW_IMP_SYMBOL(GetStartupInfoA))(LPSTARTUPINFO) asm("__imp__GetStartupInfoA@4") = GetStartupInfo;
VOID (WINAPI *__MINGW_IMP_SYMBOL(GetStartupInfoW))(LPSTARTUPINFO) asm("__imp__GetStartupInfoW@4") = GetStartupInfo;
#else
diff --git a/mingw-w64-libraries/winstorecompat/src/GetTickCount.c b/mingw-w64-libraries/winstorecompat/src/GetTickCount.c
index 92113f3..83dd18f 100644
--- a/mingw-w64-libraries/winstorecompat/src/GetTickCount.c
+++ b/mingw-w64-libraries/winstorecompat/src/GetTickCount.c
@@ -34,7 +34,7 @@ DWORD WINAPI GetTickCount(void)
return (DWORD)GetTickCount64();
}
-#ifndef _WIN64
+#ifdef _X86_
DWORD (WINAPI *__MINGW_IMP_SYMBOL(GetTickCount))(void) asm("__imp__GetTickCount@0") = GetTickCount;
#else
DWORD (WINAPI *__MINGW_IMP_SYMBOL(GetTickCount))(void) asm("__imp_GetTickCount") = GetTickCount;
diff --git a/mingw-w64-libraries/winstorecompat/src/InitializeCriticalSection.c b/mingw-w64-libraries/winstorecompat/src/InitializeCriticalSection.c
index 26970bf..998d0e5 100644
--- a/mingw-w64-libraries/winstorecompat/src/InitializeCriticalSection.c
+++ b/mingw-w64-libraries/winstorecompat/src/InitializeCriticalSection.c
@@ -36,7 +36,7 @@ void WINAPI InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
InitializeCriticalSectionEx(lpCriticalSection, 0, flags);
}
-#ifndef _WIN64
+#ifdef _X86_
void (WINAPI *__MINGW_IMP_SYMBOL(InitializeCriticalSection))(LPCRITICAL_SECTION lpCriticalSection) asm("__imp__InitializeCriticalSection@4") = InitializeCriticalSection;
#else
void (WINAPI *__MINGW_IMP_SYMBOL(InitializeCriticalSection))(LPCRITICAL_SECTION lpCriticalSection) asm("__imp_InitializeCriticalSection") = InitializeCriticalSection;
diff --git a/mingw-w64-libraries/winstorecompat/src/IsDBCSLeadByteEx.c b/mingw-w64-libraries/winstorecompat/src/IsDBCSLeadByteEx.c
index 985a318..b56ce24 100644
--- a/mingw-w64-libraries/winstorecompat/src/IsDBCSLeadByteEx.c
+++ b/mingw-w64-libraries/winstorecompat/src/IsDBCSLeadByteEx.c
@@ -46,7 +46,7 @@ BOOL WINAPI IsDBCSLeadByteEx( UINT CodePage, BYTE TestChar )
return FALSE;
}
-#ifndef _WIN64
+#ifdef _X86_
BOOL (WINAPI *__MINGW_IMP_SYMBOL(IsDBCSLeadByteEx))(UINT CodePage, BYTE TestChar) asm("__imp__IsDBCSLeadByteEx@8") = IsDBCSLeadByteEx;
#else
BOOL (WINAPI *__MINGW_IMP_SYMBOL(IsDBCSLeadByteEx))(UINT CodePage, BYTE TestChar) asm("__imp_IsDBCSLeadByteEx") = IsDBCSLeadByteEx;
diff --git a/mingw-w64-libraries/winstorecompat/src/LoadLibraryW.c b/mingw-w64-libraries/winstorecompat/src/LoadLibraryW.c
index b5a2481..633cbd2 100644
--- a/mingw-w64-libraries/winstorecompat/src/LoadLibraryW.c
+++ b/mingw-w64-libraries/winstorecompat/src/LoadLibraryW.c
@@ -34,7 +34,7 @@ HMODULE WINAPI LoadLibraryW(LPCWSTR lpFileName)
return LoadPackagedLibrary(lpFileName, 0);
}
-#ifndef _WIN64
+#ifdef _X86_
HMODULE (WINAPI *__MINGW_IMP_SYMBOL(LoadLibraryW))(LPCWSTR lpFileName) asm("__imp__LoadLibraryW@4") = LoadLibraryW;
#else
HMODULE (WINAPI *__MINGW_IMP_SYMBOL(LoadLibraryW))(LPCWSTR lpFileName) asm("__imp_LoadLibraryW") = LoadLibraryW;
diff --git a/mingw-w64-libraries/winstorecompat/src/LocalAlloc.c b/mingw-w64-libraries/winstorecompat/src/LocalAlloc.c
index 9d5acb7..d07c77a 100644
--- a/mingw-w64-libraries/winstorecompat/src/LocalAlloc.c
+++ b/mingw-w64-libraries/winstorecompat/src/LocalAlloc.c
@@ -38,7 +38,7 @@ HLOCAL WINAPI LocalAlloc(UINT uFlags, SIZE_T uBytes)
return HeapAlloc(GetProcessHeap(), (uFlags & LMEM_ZEROINIT) ? HEAP_ZERO_MEMORY : 0, uBytes);
}
-#ifndef _WIN64
+#ifdef _X86_
HLOCAL (WINAPI *__MINGW_IMP_SYMBOL(LocalAlloc))(UINT uFlags, SIZE_T uByte) asm("__imp__LocalAlloc@8") = LocalAlloc;
#else
HLOCAL (WINAPI *__MINGW_IMP_SYMBOL(LocalAlloc))(UINT uFlags, SIZE_T uByte) asm("__imp_LocalAlloc") = LocalAlloc;
diff --git a/mingw-w64-libraries/winstorecompat/src/LocalFree.c b/mingw-w64-libraries/winstorecompat/src/LocalFree.c
index daacf92..6852849 100644
--- a/mingw-w64-libraries/winstorecompat/src/LocalFree.c
+++ b/mingw-w64-libraries/winstorecompat/src/LocalFree.c
@@ -37,7 +37,7 @@ HLOCAL WINAPI LocalFree(HLOCAL hMem)
return hMem;
}
-#ifndef _WIN64
+#ifdef _X86_
HLOCAL (WINAPI *__MINGW_IMP_SYMBOL(LocalFree))(HLOCAL hMem) asm("__imp__LocalFree@4") = LocalFree;
#else
HLOCAL (WINAPI *__MINGW_IMP_SYMBOL(LocalFree))(HLOCAL hMem) asm("__imp_LocalFree") = LocalFree;
diff --git a/mingw-w64-libraries/winstorecompat/src/QueueTimer.c b/mingw-w64-libraries/winstorecompat/src/QueueTimer.c
index 2a4c563..8f0481d 100644
--- a/mingw-w64-libraries/winstorecompat/src/QueueTimer.c
+++ b/mingw-w64-libraries/winstorecompat/src/QueueTimer.c
@@ -45,7 +45,7 @@ WINBOOL WINAPI DeleteTimerQueueTimer (HANDLE TimerQueue, HANDLE Timer, HANDLE Co
return 0;
}
-#ifndef _WIN64
+#ifdef _X86_
WINBOOL (WINAPI *__MINGW_IMP_SYMBOL(CreateTimerQueueTimer)) (PHANDLE phNewTimer, HANDLE TimerQueue, WAITORTIMERCALLBACK Callback, PVOID Parameter, DWORD DueTime, DWORD Period, ULONG Flags) asm("__imp__CreateTimerQueueTimer@28") = CreateTimerQueueTimer;
WINBOOL (WINAPI *__MINGW_IMP_SYMBOL(DeleteTimerQueueTimer)) (HANDLE TimerQueue, HANDLE Timer, HANDLE CompletionEvent) asm("__imp__DeleteTimerQueueTimer@12") = DeleteTimerQueueTimer;
#else
diff --git a/mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c b/mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c
index 93ca1b5..6982982 100644
--- a/mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c
+++ b/mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c
@@ -34,7 +34,7 @@ HRESULT WINAPI SHGetFolderPathW(HWND hwnd,int csidl,HANDLE hToken,DWORD dwFlags,
return S_FALSE;
}
-#ifndef _WIN64
+#ifdef _X86_
HRESULT (WINAPI *__MINGW_IMP_SYMBOL(SHGetFolderPathW))(HWND hwnd,int csidl,HANDLE hToken,DWORD dwFlags,LPWSTR pszPath) asm("__imp__SHGetFolderPathW@20") = SHGetFolderPathW;
#else
HRESULT (WINAPI *__MINGW_IMP_SYMBOL(SHGetFolderPathW))(HWND hwnd,int csidl,HANDLE hToken,DWORD dwFlags,LPWSTR pszPath) asm("__imp_SHGetFolderPathW") = SHGetFolderPathW;
diff --git a/mingw-w64-libraries/winstorecompat/src/SetErrorMode.c b/mingw-w64-libraries/winstorecompat/src/SetErrorMode.c
index d42b521..3f9da86 100644
--- a/mingw-w64-libraries/winstorecompat/src/SetErrorMode.c
+++ b/mingw-w64-libraries/winstorecompat/src/SetErrorMode.c
@@ -35,7 +35,7 @@ UINT WINAPI SetErrorMode(UINT uMode)
return InterlockedExchange(&oldMode, (LONG)uMode);
}
-#ifndef _WIN64
+#ifdef _X86_
UINT (WINAPI *__MINGW_IMP_SYMBOL(SetErrorMode))(UINT uMode) asm("__imp__SetErrorMode@4") = SetErrorMode;
#else
UINT (WINAPI *__MINGW_IMP_SYMBOL(SetErrorMode))(UINT uMode) asm("__imp_SetErrorMode") = SetErrorMode;
diff --git a/mingw-w64-libraries/winstorecompat/src/SetFilePointer.c b/mingw-w64-libraries/winstorecompat/src/SetFilePointer.c
index 337559d..17b474f 100644
--- a/mingw-w64-libraries/winstorecompat/src/SetFilePointer.c
+++ b/mingw-w64-libraries/winstorecompat/src/SetFilePointer.c
@@ -56,7 +56,7 @@ DWORD WINAPI SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistance
return newpos.u.LowPart;
}
-#ifndef _WIN64
+#ifdef _X86_
DWORD (WINAPI *__MINGW_IMP_SYMBOL(SetFilePointer))(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) asm("__imp__SetFilePointer@16") = SetFilePointer;
#else
DWORD (WINAPI *__MINGW_IMP_SYMBOL(SetFilePointer))(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) asm("__imp_SetFilePointer") = SetFilePointer;
diff --git a/mingw-w64-libraries/winstorecompat/src/SetUnhandledExceptionFilter.c b/mingw-w64-libraries/winstorecompat/src/SetUnhandledExceptionFilter.c
index 0126c89..17b8c59 100644
--- a/mingw-w64-libraries/winstorecompat/src/SetUnhandledExceptionFilter.c
+++ b/mingw-w64-libraries/winstorecompat/src/SetUnhandledExceptionFilter.c
@@ -39,7 +39,7 @@ LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCE
return (LPTOP_LEVEL_EXCEPTION_FILTER)(INT_PTR)InterlockedExchangePointer(target, lpTopLevelExceptionFilter);
}
-#ifndef _WIN64
+#ifdef _X86_
LPTOP_LEVEL_EXCEPTION_FILTER (WINAPI *__MINGW_IMP_SYMBOL(SetUnhandledExceptionFilter))(LPTOP_LEVEL_EXCEPTION_FILTER) asm("__imp__SetUnhandledExceptionFilter@4") = SetUnhandledExceptionFilter;
#else
LPTOP_LEVEL_EXCEPTION_FILTER (WINAPI *__MINGW_IMP_SYMBOL(SetUnhandledExceptionFilter))(LPTOP_LEVEL_EXCEPTION_FILTER) asm("__imp_SetUnhandledExceptionFilter") = SetUnhandledExceptionFilter;
diff --git a/mingw-w64-libraries/winstorecompat/src/Sleep.c b/mingw-w64-libraries/winstorecompat/src/Sleep.c
index 9803aa8..cc714be 100644
--- a/mingw-w64-libraries/winstorecompat/src/Sleep.c
+++ b/mingw-w64-libraries/winstorecompat/src/Sleep.c
@@ -34,7 +34,7 @@ VOID WINAPI Sleep(DWORD dwMilliseconds)
WaitForSingleObjectEx(GetCurrentThread(), dwMilliseconds, FALSE);
}
-#ifndef _WIN64
+#ifdef _X86_
VOID (WINAPI *__MINGW_IMP_SYMBOL(Sleep))(DWORD dwMilliseconds) asm("__imp__Sleep@4") = Sleep;
#else
VOID (WINAPI *__MINGW_IMP_SYMBOL(Sleep))(DWORD dwMilliseconds) asm("__imp_Sleep") = Sleep;
diff --git a/mingw-w64-libraries/winstorecompat/src/SleepEx.c b/mingw-w64-libraries/winstorecompat/src/SleepEx.c
index 2d0c6f4..d65ca56 100644
--- a/mingw-w64-libraries/winstorecompat/src/SleepEx.c
+++ b/mingw-w64-libraries/winstorecompat/src/SleepEx.c
@@ -38,7 +38,7 @@ DWORD WINAPI SleepEx(DWORD dwMilliseconds, BOOL bAlertable)
return ret;
}
-#ifndef _WIN64
+#ifdef _X86_
DWORD (WINAPI *__MINGW_IMP_SYMBOL(SleepEx))(DWORD dwMilliseconds, BOOL bAlertable) asm("__imp__SleepEx@8") = SleepEx;
#else
DWORD (WINAPI *__MINGW_IMP_SYMBOL(SleepEx))(DWORD dwMilliseconds, BOOL bAlertable) asm("__imp_SleepEx") = SleepEx;
diff --git a/mingw-w64-libraries/winstorecompat/src/TerminateProcess.c b/mingw-w64-libraries/winstorecompat/src/TerminateProcess.c
index b6fa49c..026014f 100644
--- a/mingw-w64-libraries/winstorecompat/src/TerminateProcess.c
+++ b/mingw-w64-libraries/winstorecompat/src/TerminateProcess.c
@@ -41,7 +41,7 @@ BOOL WINAPI TerminateProcess(HANDLE hProcess, UINT uExitCode)
}
}
-#ifndef _WIN64
+#ifdef _X86_
BOOL (WINAPI *__MINGW_IMP_SYMBOL(TerminateProcess))(HANDLE, UINT) asm("__imp__TerminateProcess@8") = TerminateProcess;
#else
BOOL (WINAPI *__MINGW_IMP_SYMBOL(TerminateProcess))(HANDLE, UINT) asm("__imp_TerminateProcess") = TerminateProcess;
diff --git a/mingw-w64-libraries/winstorecompat/src/Tls.c b/mingw-w64-libraries/winstorecompat/src/Tls.c