Re: [Mingw-w64-public] [PATCH 1/6] winpthreads: simplify the USE_VEH_FOR_MSC_SETTHREADNAME check

2020-05-19 Thread Liu Hao
在 2020/5/18 22:43, Steve Lhomme 写道:
> Hi,
> 
> Any update on this patchset ?
> 
> 

No.

I pushed these patches to master for testing.



-- 
Best regards,
LH_Mouse



signature.asc
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 1/6] winpthreads: simplify the USE_VEH_FOR_MSC_SETTHREADNAME check

2020-05-18 Thread Steve Lhomme

Hi,

Any update on this patchset ?

On 2020-04-08 17:13, Steve Lhomme wrote:

When compiling with other compilers than MSVC, we always use the code
relying on USE_VEH_FOR_MSC_SETTHREADNAME.

The __try/__except check code is not modified as it relies on internal MSVC
dialect. With MSVC either USE_VEH_FOR_MSC_SETTHREADNAME was set but that code
wasn't use anyway (unchanged) or it wasn't set and we use the code (unchanged).
Without MSVC we always define USE_VEH_FOR_MSC_SETTHREADNAME so the other
variant of the code is used (unchanged).
---
  mingw-w64-libraries/winpthreads/src/thread.c | 10 +++---
  1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 1b12edb4..10405116 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -54,7 +54,11 @@ 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)

+#if !defined(_MSC_VER)
+#define USE_VEH_FOR_MSC_SETTHREADNAME
+#endif
+
+#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
  static void *SetThreadName_VEH_handle = NULL;
  
  static LONG __stdcall

@@ -419,7 +423,7 @@ __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 defined(USE_VEH_FOR_MSC_SETTHREADNAME)
if (lpreserved == NULL && SetThreadName_VEH_handle != NULL)
  {
RemoveVectoredExceptionHandler (SetThreadName_VEH_handle);
@@ -430,7 +434,7 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason, 
LPVOID lpreserved)
  }
else if (dwReason == DLL_PROCESS_ATTACH)
  {
-#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
+#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
SetThreadName_VEH_handle = AddVectoredExceptionHandler (1, 
_VEH);
/* Can't do anything on error anyway, check for NULL later */
  #endif
--
2.17.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 1/6] winpthreads: simplify the USE_VEH_FOR_MSC_SETTHREADNAME check

2020-04-08 Thread LRN
On 08.04.2020 18:13, Steve Lhomme wrote:
> When compiling with other compilers than MSVC, we always use the code
> relying on USE_VEH_FOR_MSC_SETTHREADNAME.
> 
> -#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
> +#if !defined(_MSC_VER)
> +#define USE_VEH_FOR_MSC_SETTHREADNAME
> +#endif
> +

I think the idea was to allow this code to be optionally used with MSVC
(nothing prevents it from working with MSVC, other than the fact that there's
an MSVC-specific alternative available).



signature.asc
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 1/6] winpthreads: simplify the USE_VEH_FOR_MSC_SETTHREADNAME check

2020-04-08 Thread Steve Lhomme
When compiling with other compilers than MSVC, we always use the code
relying on USE_VEH_FOR_MSC_SETTHREADNAME.

The __try/__except check code is not modified as it relies on internal MSVC
dialect. With MSVC either USE_VEH_FOR_MSC_SETTHREADNAME was set but that code
wasn't use anyway (unchanged) or it wasn't set and we use the code (unchanged).
Without MSVC we always define USE_VEH_FOR_MSC_SETTHREADNAME so the other
variant of the code is used (unchanged).
---
 mingw-w64-libraries/winpthreads/src/thread.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 1b12edb4..10405116 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -54,7 +54,11 @@ 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)
+#if !defined(_MSC_VER)
+#define USE_VEH_FOR_MSC_SETTHREADNAME
+#endif
+
+#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
 static void *SetThreadName_VEH_handle = NULL;
 
 static LONG __stdcall
@@ -419,7 +423,7 @@ __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 defined(USE_VEH_FOR_MSC_SETTHREADNAME)
   if (lpreserved == NULL && SetThreadName_VEH_handle != NULL)
 {
   RemoveVectoredExceptionHandler (SetThreadName_VEH_handle);
@@ -430,7 +434,7 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason, 
LPVOID lpreserved)
 }
   else if (dwReason == DLL_PROCESS_ATTACH)
 {
-#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
+#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
   SetThreadName_VEH_handle = AddVectoredExceptionHandler (1, 
_VEH);
   /* Can't do anything on error anyway, check for NULL later */
 #endif
-- 
2.17.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public