thread: Fixed detection of thread libraries on Windows.
Этот коммит содержится в:
родитель
f97928c740
Коммит
aff5786ed3
@ -110,9 +110,11 @@ if (Z_LIBRARY)
|
|||||||
endif (Z_LIBRARY)
|
endif (Z_LIBRARY)
|
||||||
|
|
||||||
if (CMAKE_HAVE_THREADS_LIBRARY)
|
if (CMAKE_HAVE_THREADS_LIBRARY)
|
||||||
set(HAVE_PTHREAD 1)
|
if (CMAKE_HAVE_PTHREADS_CREATE OR CMAKE_HAVE_PTHREAD_CREATE)
|
||||||
|
set(HAVE_PTHREAD 1)
|
||||||
|
|
||||||
set(LIBSSH_REQUIRED_LIBRARIES ${LIBSSH_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
set(LIBSSH_REQUIRED_LIBRARIES ${LIBSSH_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
endif (CMAKE_HAVE_PTHREADS_CREATE OR CMAKE_HAVE_PTHREAD_CREATE)
|
||||||
endif (CMAKE_HAVE_THREADS_LIBRARY)
|
endif (CMAKE_HAVE_THREADS_LIBRARY)
|
||||||
|
|
||||||
# OPTIONS
|
# OPTIONS
|
||||||
|
@ -30,12 +30,13 @@
|
|||||||
#include "libssh/priv.h"
|
#include "libssh/priv.h"
|
||||||
#include "libssh/threads.h"
|
#include "libssh/threads.h"
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
|
||||||
#ifndef HAVE_PTHREAD
|
#ifndef HAVE_PTHREAD
|
||||||
#warning "You do not have any threading library installed. If the linked"
|
#warning "You do not have any threading library installed. If the linked"
|
||||||
#warning "application doesn't provide the threading callbacks, you're screwed"
|
#warning "application doesn't provide the threading callbacks, you're screwed"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define HAVE_PTHREAD
|
|
||||||
#ifdef HAVE_PTHREAD
|
#ifdef HAVE_PTHREAD
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
@ -82,7 +83,8 @@ static struct ssh_threads_callbacks_struct ssh_pthread_user_callbacks=
|
|||||||
.thread_id=ssh_pthread_thread_id
|
.thread_id=ssh_pthread_thread_id
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif /* HAVE_PTHREAD */
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
static struct ssh_threads_callbacks_struct *user_callbacks;
|
static struct ssh_threads_callbacks_struct *user_callbacks;
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user