0002-clang-std-replacements-leak.patch 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. diff --git a/thirdparty/mingw-std-threads/mingw.condition_variable.h b/thirdparty/mingw-std-threads/mingw.condition_variable.h
  2. index f9e248c154..d099fad2ec 100644
  3. --- a/thirdparty/mingw-std-threads/mingw.condition_variable.h
  4. +++ b/thirdparty/mingw-std-threads/mingw.condition_variable.h
  5. @@ -58,7 +58,7 @@
  6. namespace mingw_stdthread
  7. {
  8. -#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)
  9. +#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)
  10. enum class cv_status { no_timeout, timeout };
  11. #else
  12. using std::cv_status;
  13. @@ -547,7 +547,7 @@ namespace std
  14. // was none. Direct specification (std::), however, would be unaffected.
  15. // Take the safe option, and include only in the presence of MinGW's win32
  16. // implementation.
  17. -#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)
  18. +#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)
  19. using mingw_stdthread::cv_status;
  20. using mingw_stdthread::condition_variable;
  21. using mingw_stdthread::condition_variable_any;
  22. diff --git a/thirdparty/mingw-std-threads/mingw.mutex.h b/thirdparty/mingw-std-threads/mingw.mutex.h
  23. index 73698d13cb..1e881e6c7d 100644
  24. --- a/thirdparty/mingw-std-threads/mingw.mutex.h
  25. +++ b/thirdparty/mingw-std-threads/mingw.mutex.h
  26. @@ -480,7 +480,7 @@ namespace std
  27. // was none. Direct specification (std::), however, would be unaffected.
  28. // Take the safe option, and include only in the presence of MinGW's win32
  29. // implementation.
  30. -#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)
  31. +#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)
  32. using mingw_stdthread::recursive_mutex;
  33. using mingw_stdthread::mutex;
  34. using mingw_stdthread::recursive_timed_mutex;
  35. diff --git a/thirdparty/mingw-std-threads/mingw.shared_mutex.h b/thirdparty/mingw-std-threads/mingw.shared_mutex.h
  36. index 5375b0fbd1..ddc46bb826 100644
  37. --- a/thirdparty/mingw-std-threads/mingw.shared_mutex.h
  38. +++ b/thirdparty/mingw-std-threads/mingw.shared_mutex.h
  39. @@ -484,10 +484,10 @@ namespace std
  40. // was none. Direct specification (std::), however, would be unaffected.
  41. // Take the safe option, and include only in the presence of MinGW's win32
  42. // implementation.
  43. -#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS))
  44. +#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__))
  45. using mingw_stdthread::shared_mutex;
  46. #endif
  47. -#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS))
  48. +#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__))
  49. using mingw_stdthread::shared_timed_mutex;
  50. using mingw_stdthread::shared_lock;
  51. #elif !defined(MINGW_STDTHREAD_REDUNDANCY_WARNING) // Skip repetition
  52. diff --git a/thirdparty/mingw-std-threads/mingw.thread.h b/thirdparty/mingw-std-threads/mingw.thread.h
  53. index 4bcc63e1b1..60d2200db2 100644
  54. --- a/thirdparty/mingw-std-threads/mingw.thread.h
  55. +++ b/thirdparty/mingw-std-threads/mingw.thread.h
  56. @@ -325,7 +325,7 @@ namespace std
  57. // was none. Direct specification (std::), however, would be unaffected.
  58. // Take the safe option, and include only in the presence of MinGW's win32
  59. // implementation.
  60. -#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)
  61. +#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)
  62. using mingw_stdthread::thread;
  63. // Remove ambiguity immediately, to avoid problems arising from the above.
  64. //using std::thread;