X-Git-Url: https://git.syn-net.org/debian/?p=anytun.git;a=blobdiff_plain;f=src%2Fcryptinit.hpp;h=17bb82597683902a44cbc908390885085faa28fa;hp=cd112151617dd1f2ab65cd3f8cbdf33075809fe8;hb=91d2dadab8997ae23442f77dd28db9fa3aee1e7c;hpb=65944fb7a518dc659bacaf80cf235a0352fc6a7e diff --git a/src/cryptinit.hpp b/src/cryptinit.hpp index cd11215..17bb825 100644 --- a/src/cryptinit.hpp +++ b/src/cryptinit.hpp @@ -48,27 +48,33 @@ #ifndef NO_CRYPT +#include "anytunError.h" + #if defined(USE_GCRYPT) #include +#if GCRYPT_VERSION_NUMBER < 0x010600 #if defined(BOOST_HAS_PTHREADS) // boost thread callbacks for libgcrypt GCRY_THREAD_OPTION_PTHREAD_IMPL; #else #error You can not use gcrypt without pthreads - please configure Boost to use pthreads! -#endif +#endif // defined(BOOST_HAS_PTHREADS) +#endif // GCRYPT_VERSION_NUMBER < 0x010600 #define MIN_GCRYPT_VERSION "1.2.0" bool initLibGCrypt() { +#if GCRYPT_VERSION_NUMBER < 0x010600 #if defined(BOOST_HAS_PTHREADS) // make libgcrypt thread safe // this must be called before any other libgcrypt call gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); #else #error You can not use gcrypt without pthreads - please configure Boost to use pthreads! -#endif +#endif // defined(BOOST_HAS_PTHREADS) +#endif // GCRYPT_VERSION_NUMBER < 0x010600 // this must be called right after the GCRYCTL_SET_THREAD_CBS command // no other function must be called till now