-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmingw-w64-v7.patch
141 lines (130 loc) · 4.49 KB
/
mingw-w64-v7.patch
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
diff --git a/mingw-w64-v7.0.0/mingw-w64-headers/crt/ctype.h b/mingw-w64-v7.0.0/mingw-w64-headers/crt/ctype.h
index 9d09833..9b45a9e 100644
--- a/mingw-w64-v7.0.0/mingw-w64-headers/crt/ctype.h
+++ b/mingw-w64-v7.0.0/mingw-w64-headers/crt/ctype.h
@@ -193,7 +193,7 @@ int __cdecl iswblank(wint_t _C);
#ifndef _CTYPE_DISABLE_MACROS
#ifndef MB_CUR_MAX
-#define MB_CUR_MAX ___mb_cur_max_func()
+#define MB_CUR_MAX __mb_cur_max
#ifndef __mb_cur_max
#ifdef _MSVCRT_
extern int __mb_cur_max;
@@ -202,7 +202,7 @@ int __cdecl iswblank(wint_t _C);
#ifndef _UCRT
extern int * __MINGW_IMP_SYMBOL(__mb_cur_max);
#endif
-#define __mb_cur_max (___mb_cur_max_func())
+#define __mb_cur_max __mb_cur_max
#endif
#endif
_CRTIMP int __cdecl ___mb_cur_max_func(void);
diff --git a/mingw-w64-v7.0.0/mingw-w64-headers/crt/stdlib.h b/mingw-w64-v7.0.0/mingw-w64-headers/crt/stdlib.h
index 7d758f3..e85ef93 100644
--- a/mingw-w64-v7.0.0/mingw-w64-headers/crt/stdlib.h
+++ b/mingw-w64-v7.0.0/mingw-w64-headers/crt/stdlib.h
@@ -106,7 +106,7 @@ extern "C" {
#define RAND_MAX 0x7fff
#ifndef MB_CUR_MAX
-#define MB_CUR_MAX ___mb_cur_max_func()
+#define MB_CUR_MAX __mb_cur_max
#ifndef __mb_cur_max
#ifdef _MSVCRT_
extern int __mb_cur_max;
@@ -115,7 +115,7 @@ extern "C" {
#ifndef _UCRT
extern int * __MINGW_IMP_SYMBOL(__mb_cur_max);
#endif
-#define __mb_cur_max (___mb_cur_max_func())
+#define __mb_cur_max __mb_cur_max
#endif
#endif
_CRTIMP int __cdecl ___mb_cur_max_func(void);
diff --git a/mingw-w64-v7.0.0/mingw-w64-headers/include/tdi.h b/mingw-w64-v7.0.0/mingw-w64-headers/include/tdi.h
index 3120070..6c5298b 100644
--- a/mingw-w64-v7.0.0/mingw-w64-headers/include/tdi.h
+++ b/mingw-w64-v7.0.0/mingw-w64-headers/include/tdi.h
@@ -24,8 +24,8 @@
#define __TDI_H
#include "ntddtdi.h"
-#include "tdistat.h"
-#include "netpnp.h"
+#include "ddk/tdistat.h"
+#include "ddk/netpnp.h"
#ifdef __cplusplus
extern "C" {
diff --git a/mingw-w64-v7.0.0/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w64-v7.0.0/mingw-w64-libraries/winpthreads/src/thread.c
index 1b12edb..d214376 100644
--- a/mingw-w64-v7.0.0/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-v7.0.0/mingw-w64-libraries/winpthreads/src/thread.c
@@ -30,6 +30,7 @@
#include "thread.h"
#include "misc.h"
#include "winpthread_internal.h"
+#include <pseh/pseh.h>
static _pthread_v *__pthread_self_lite (void);
@@ -54,20 +55,6 @@ static size_t idListCnt = 0;
static size_t idListMax = 0;
static pthread_t idListNextId = 0;
-#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
-static void *SetThreadName_VEH_handle = NULL;
-
-static LONG __stdcall
-SetThreadName_VEH (PEXCEPTION_POINTERS ExceptionInfo)
-{
- if (ExceptionInfo->ExceptionRecord != NULL &&
- ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_SET_THREAD_NAME)
- return EXCEPTION_CONTINUE_EXECUTION;
-
- return EXCEPTION_CONTINUE_SEARCH;
-}
-#endif
-
typedef struct _THREADNAME_INFO
{
DWORD dwType; /* must be 0x1000 */
@@ -89,23 +76,14 @@ SetThreadName (DWORD dwThreadID, LPCSTR szThreadName)
infosize = sizeof (info) / sizeof (ULONG_PTR);
-#if defined(_MSC_VER) && !defined (USE_VEH_FOR_MSC_SETTHREADNAME)
- __try
+ _SEH_TRY
{
RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR *)&info);
}
- __except (EXCEPTION_EXECUTE_HANDLER)
+ _SEH_HANDLE
{
}
-#else
- /* Without a debugger we *must* have an exception handler,
- * otherwise raising an exception will crash the process.
- */
- if ((!IsDebuggerPresent ()) && (SetThreadName_VEH_handle == NULL))
- return;
-
- RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR *) &info);
-#endif
+ _SEH_END;
}
/* Search the list idList for an element with identifier ID. If
@@ -419,21 +397,10 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
if (dwReason == DLL_PROCESS_DETACH)
{
-#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
- if (lpreserved == NULL && SetThreadName_VEH_handle != NULL)
- {
- RemoveVectoredExceptionHandler (SetThreadName_VEH_handle);
- SetThreadName_VEH_handle = NULL;
- }
-#endif
free_pthread_mem ();
}
else if (dwReason == DLL_PROCESS_ATTACH)
{
-#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
- SetThreadName_VEH_handle = AddVectoredExceptionHandler (1, &SetThreadName_VEH);
- /* Can't do anything on error anyway, check for NULL later */
-#endif
}
else if (dwReason == DLL_THREAD_DETACH)
{