This patch series enables building winpthreads with MSVC. The missing
steps were about removing uses of GCC extensions, in favor of using
functions already provided by windows.h. MinGW also provides these
functions, so there should be no need for redefinitions in
winpthreads.

This v2 patch series differs from the v1 in how it uses recent WinAPI
functions (e.g., GetTickCount64) and respects the current way of
loading theses functions at runtime with GetModuleHandle and
GetProcAddress. It uses a function tagged with the constructor
attribute for MinGW and clang-cl, and a CRT initialization and linker
trick to use a single 'winpthreads_init' function to load these
required WinAPI functions.

Antonin Décimo (8):
  winpthreads: Check if requested stack size fits in an unsigned int
  winpthreads: Fix pthread_create_wrapper type
  winpthreads: Use YieldProcessor in pthread_spin_lock
  winpthreads: Replace GCC's __sync comparisons with WinAPI functions
  winpthreads: Don't use GCC __sync_synchronize
  winpthreads: Unify discovery of recent WinAPI functions
  winpthreads: Simplify placing a symbol in a section
  winpthreads: Use GetModuleHandleA to prevent Unicode errors

 .../winpthreads/include/pthread.h             |  6 +--
 mingw-w64-libraries/winpthreads/src/clock.c   | 31 ++-------------
 mingw-w64-libraries/winpthreads/src/misc.c    | 38 ++++++++++++++++---
 mingw-w64-libraries/winpthreads/src/misc.h    | 14 +------
 mingw-w64-libraries/winpthreads/src/mutex.c   | 15 ++++----
 .../winpthreads/src/spinlock.c                | 12 ++----
 mingw-w64-libraries/winpthreads/src/thread.c  | 18 +++++----
 7 files changed, 62 insertions(+), 72 deletions(-)

-- 
2.43.0



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

Reply via email to