summarylogtreecommitdiffstats
path: root/mingw.patch
blob: 8547ae9c666d1aee0def9a0f24cccf1539f0a463 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
diff -ruN AviSynthPlus-3.7.3/avs_core/CMakeLists.txt patched/avs_core/CMakeLists.txt
--- AviSynthPlus-3.7.3/avs_core/CMakeLists.txt	2023-07-16 02:44:05.000000000 +0200
+++ patched/avs_core/CMakeLists.txt	2023-07-27 13:57:04.060000000 +0200
@@ -111,7 +111,7 @@
 elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
     set(SYSLIB "pthread")
 elseif(MSVC OR MINGW)
-    set(SYSLIB "uuid" "winmm" "vfw32" "msacm32" "gdi32" "user32" "advapi32" "ole32" "imagehlp")
+    set(SYSLIB "uuid" "winmm" "vfw32" "msacm32" "gdi32" "user32" "advapi32" "ole32" "imagehlp" "ssp")
 else()
     set(SYSLIB "pthread" "dl" "m")
 endif()
diff -ruN AviSynthPlus-3.7.3/avs_core/core/BufferPool.h patched/avs_core/core/BufferPool.h
--- AviSynthPlus-3.7.3/avs_core/core/BufferPool.h	2023-07-16 02:44:05.000000000 +0200
+++ patched/avs_core/core/BufferPool.h	2023-07-27 13:54:14.396666668 +0200
@@ -11,12 +11,12 @@
 private:
 
   struct BufferDesc;
-  typedef std::multimap<size_t, BufferDesc*> MapType;
+  typedef std::multimap<std::size_t, BufferDesc*> MapType;
 
   InternalEnvironment* Env;
   MapType Map;
 
-  void* PrivateAlloc(size_t nBytes, size_t alignment, void* user);
+  void* PrivateAlloc(std::size_t nBytes, std::size_t alignment, void* user);
   void PrivateFree(void* buffer);
 
 public:
@@ -24,7 +24,7 @@
   BufferPool(InternalEnvironment* env);
   ~BufferPool();
 
-  void* Allocate(size_t nBytes, size_t alignment, bool pool);
+  void* Allocate(std::size_t nBytes, std::size_t alignment, bool pool);
   void Free(void* ptr);
 
 };
diff -ruN AviSynthPlus-3.7.3/avs_core/core/internal.h patched/avs_core/core/internal.h
--- AviSynthPlus-3.7.3/avs_core/core/internal.h	2023-07-16 02:44:05.000000000 +0200
+++ patched/avs_core/core/internal.h	2023-07-27 13:54:14.396666668 +0200
@@ -47,7 +47,7 @@
 #include <limits.h>
 #endif
 #include "InternalEnvironment.h"
-#ifdef INTEL_INTRINSICS
+#if defined(INTEL_INTRINSICS) && !defined(__MINGW32__)
 #ifdef AVS_WINDOWS
 #include <intrin.h>
 #else
diff -ruN AviSynthPlus-3.7.3/avs_core/core/ThreadPool.h patched/avs_core/core/ThreadPool.h
--- AviSynthPlus-3.7.3/avs_core/core/ThreadPool.h	2023-07-16 02:44:05.000000000 +0200
+++ patched/avs_core/core/ThreadPool.h	2023-07-27 13:54:14.396666668 +0200
@@ -42,7 +42,7 @@
     return ret;
   }
 
-  virtual ~JobCompletion()
+  virtual __stdcall ~JobCompletion()
   {
     Wait();
     delete [] pairs;
diff -ruN AviSynthPlus-3.7.3/avs_core/filters/AviSource/avi_source.cpp patched/avs_core/filters/AviSource/avi_source.cpp
--- AviSynthPlus-3.7.3/avs_core/filters/AviSource/avi_source.cpp	2023-07-16 02:44:05.000000000 +0200
+++ patched/avs_core/filters/AviSource/avi_source.cpp	2023-07-27 13:54:14.396666668 +0200
@@ -298,7 +298,7 @@
     return result;
 }
 
-#ifndef MSVC
+#if !defined(MSVC) && !defined(__MINGW32__)
 static __inline LRESULT
 ICDecompressEx(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiSrc,LPVOID lpSrc,INT xSrc,INT ySrc,INT dxSrc,INT dySrc,LPBITMAPINFOHEADER lpbiDst,LPVOID lpDst,INT xDst,INT yDst,INT dxDst,INT dyDst)
 {
diff -ruN AviSynthPlus-3.7.3/avs_core/include/avisynth.h patched/avs_core/include/avisynth.h
--- AviSynthPlus-3.7.3/avs_core/include/avisynth.h	2023-07-16 02:44:05.000000000 +0200
+++ patched/avs_core/include/avisynth.h	2023-07-27 13:54:14.400000002 +0200
@@ -1764,7 +1764,7 @@
 {
 public:
 
-  virtual ~IJobCompletion() {}
+  virtual __stdcall ~IJobCompletion() {}
   virtual void __stdcall Wait() = 0;
   virtual AVSValue __stdcall Get(size_t i) = 0;
   virtual size_t __stdcall Size() const = 0;
diff -ruN AviSynthPlus-3.7.3/plugins/ImageSeq/CMakeLists.txt patched/plugins/ImageSeq/CMakeLists.txt
--- AviSynthPlus-3.7.3/plugins/ImageSeq/CMakeLists.txt	2023-07-16 02:44:05.000000000 +0200
+++ patched/plugins/ImageSeq/CMakeLists.txt	2023-07-27 13:54:14.400000002 +0200
@@ -43,14 +43,14 @@
     # Specify include directories
     target_include_directories(${ProjectName} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/DevIL_x86 ${AvsCore_SOURCE_DIR})
     # Windows DLL dependencies
-    target_link_libraries(${ProjectName} "${CMAKE_CURRENT_SOURCE_DIR}/lib/DevIL_x86/DevIL.lib")
+    target_link_libraries(${ProjectName} "${CMAKE_CURRENT_SOURCE_DIR}/lib/DevIL_x86/DevIL.lib" "ssp")
     # Copy binary dependencies to a common folder for easy deployment
     configure_file("${PROJECT_SOURCE_DIR}/lib/DevIL_x86/DevIL.dll" "${CMAKE_BINARY_DIR}/Output/system/DevIL.dll" COPYONLY)
   else()   # 64-bit
     # Specify include directories
     target_include_directories(${ProjectName} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/DevIL_x64 ${AvsCore_SOURCE_DIR})
     # Windows DLL dependencies
-    target_link_libraries(${ProjectName} "${CMAKE_CURRENT_SOURCE_DIR}/lib/DevIL_x64/DevIL.lib")
+    target_link_libraries(${ProjectName} "${CMAKE_CURRENT_SOURCE_DIR}/lib/DevIL_x64/DevIL.lib" "ssp")
     # Copy binary dependencies to a common folder for easy deployment
     configure_file("${PROJECT_SOURCE_DIR}/lib/DevIL_x64/DevIL.dll" "${CMAKE_BINARY_DIR}/Output/system/DevIL.dll" COPYONLY)
   endif()
diff -ruN AviSynthPlus-3.7.3/plugins/VDubFilter/CMakeLists.txt patched/plugins/VDubFilter/CMakeLists.txt
--- AviSynthPlus-3.7.3/plugins/VDubFilter/CMakeLists.txt	2023-07-16 02:44:05.000000000 +0200
+++ patched/plugins/VDubFilter/CMakeLists.txt	2023-07-27 13:54:14.400000002 +0200
@@ -22,7 +22,7 @@
 endif()
 
 # Library dependencies
-target_link_libraries(${ProjectName} "user32")
+target_link_libraries(${ProjectName} "user32" "ssp")
 
 # Include directories
 target_include_directories(${ProjectName} PRIVATE ${AvsCore_SOURCE_DIR})