diff options
-rw-r--r-- | src/anytun.cpp | 5 | ||||
-rw-r--r-- | src/signalController.cpp | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp index ddfacfd..3d7dd5d 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -327,7 +327,7 @@ void receiver(void* p) } // boost thread callbacks for libgcrypt - +#if defined(BOOST_HAS_PTHREADS) typedef boost::detail::thread::lock_ops<boost::mutex> mutex_ops; static int boost_mutex_init(void **priv) @@ -361,6 +361,9 @@ static struct gcry_thread_cbs gcry_threads_boost = { GCRY_THREAD_OPTION_USER, NULL, boost_mutex_init, boost_mutex_destroy, boost_mutex_lock, boost_mutex_unlock }; +#else +#error this libgcrypt thread callbacks only work with pthreads +#endif #define MIN_GCRYPT_VERSION "1.2.0" diff --git a/src/signalController.cpp b/src/signalController.cpp index cef743f..8d9c78f 100644 --- a/src/signalController.cpp +++ b/src/signalController.cpp @@ -116,7 +116,12 @@ void SignalController::init() sigdelset(&signal_set, SIGSEGV); sigdelset(&signal_set, SIGBUS); sigdelset(&signal_set, SIGFPE); - pthread_sigmask(SIG_BLOCK, &signal_set, NULL); // TODO: remove ugly workaround + +#if defined(BOOST_HAS_PTHREADS) + pthread_sigmask(SIG_BLOCK, &signal_set, NULL); +#else +#error The signalhandler works only with pthreads +#endif thread = new boost::thread(boost::bind(handle, this)); |