aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-01-20 19:01:15 +0100
committerAndreas Schneider <asn@cryptomilk.org>2015-01-20 19:01:15 +0100
commit433f8fd5502841279aae6f416c81bb70f42d1734 (patch)
tree6b805277d8c3fba2d09f7e0c225d6f08fec85627
parentc6590bd1893a600a04a0d87ff66e0dba838a7e7b (diff)
downloadlibssh-433f8fd5502841279aae6f416c81bb70f42d1734.tar.gz
libssh-433f8fd5502841279aae6f416c81bb70f42d1734.tar.xz
libssh-433f8fd5502841279aae6f416c81bb70f42d1734.zip
threads: Fix building with POSIX threads in MinGW.
BUG: https://red.libssh.org/issues/181 Originally written by Patrick von Reth <vonreth () kde ! org>. 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 <asn@cryptomilk.org>
-rw-r--r--src/threads/pthread.c2
1 files changed, 1 insertions, 1 deletions
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();