summaryrefslogtreecommitdiff
path: root/thirdparty/etcpak/patches/windows-mingw-fixes.patch
blob: 1da60e4a4fd45b4a3ef4904ffa6d713b49c41f59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/thirdparty/etcpak/BlockData.cpp b/thirdparty/etcpak/BlockData.cpp
index a2cd032c5b..bd738085f3 100644
--- a/thirdparty/etcpak/BlockData.cpp
+++ b/thirdparty/etcpak/BlockData.cpp
@@ -15,7 +15,7 @@
 #  include <arm_neon.h>
 #endif
 
-#ifdef __SSE4_1__
+#if defined __SSE4_1__ || defined __AVX2__ || defined _MSC_VER
 #  ifdef _MSC_VER
 #    include <intrin.h>
 #    include <Windows.h>
@@ -24,12 +24,6 @@
 #  else
 #    include <x86intrin.h>
 #  endif
-#else
-#  ifndef _MSC_VER
-#    include <byteswap.h>
-#    define _bswap(x) bswap_32(x)
-#    define _bswap64(x) bswap_64(x)
-#  endif
 #endif
 
 #ifndef _bswap
diff --git a/thirdparty/etcpak/ProcessRGB.cpp b/thirdparty/etcpak/ProcessRGB.cpp
index 220d5c55e2..9dc5a78b67 100644
--- a/thirdparty/etcpak/ProcessRGB.cpp
+++ b/thirdparty/etcpak/ProcessRGB.cpp
@@ -1,5 +1,6 @@
 #include <array>
 #include <string.h>
+#include <limits>
 
 #ifdef __ARM_NEON
 #  include <arm_neon.h>
@@ -21,12 +22,6 @@
 #  else
 #    include <x86intrin.h>
 #  endif
-#else
-#  ifndef _MSC_VER
-#    include <byteswap.h>
-#    define _bswap(x) bswap_32(x)
-#    define _bswap64(x) bswap_64(x)
-#  endif
 #endif
 
 #ifndef _bswap
diff --git a/thirdparty/etcpak/System.cpp b/thirdparty/etcpak/System.cpp
index 1383d0ecd0..a09b289cb2 100644
--- a/thirdparty/etcpak/System.cpp
+++ b/thirdparty/etcpak/System.cpp
@@ -35,7 +35,7 @@ unsigned int System::CPUCores()
 
 void System::SetThreadName( std::thread& thread, const char* name )
 {
-#ifdef _WIN32
+#ifdef _MSC_VER
     const DWORD MS_VC_EXCEPTION=0x406D1388;
 
 #  pragma pack( push, 8 )