From 433f8fd5502841279aae6f416c81bb70f42d1734 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 20 Jan 2015 19:01:15 +0100 Subject: threads: Fix building with POSIX threads in MinGW. BUG: https://red.libssh.org/issues/181 Originally written by Patrick von Reth . This patch is part of the larger patch: https://projects.kde.org/projects/kdesupport/emerge/repository/revisions/master/changes/portage/win32libs/libssh/0002-add-a-way-to-test-ssh-connections-on-windows.patch MinGW (in particular, the MinGW-w64 fork) can use either posix threads or win32 threads. This patch fixes the MinGW build when using posix threads. Signed-off-by: Andreas Schneider --- src/threads/pthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/threads/pthread.c b/src/threads/pthread.c index 829fa5c6..a0a266d7 100644 --- a/src/threads/pthread.c +++ b/src/threads/pthread.c @@ -75,7 +75,7 @@ static int ssh_pthread_mutex_unlock (void **lock){ } static unsigned long ssh_pthread_thread_id (void){ -#if _WIN32 +#if defined(_WIN32) && !defined(__WINPTHREADS_VERSION) return (unsigned long) pthread_self().p; #else return (unsigned long) pthread_self(); -- cgit