Trying to fix broken MacOS build.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
/* Wrapper for GnuTLS openssl include. Needed for Windows compatibility. */
|
||||
/* Wrapper for GnuTLS openssl include. Needed for Windows/MacOS compatibility. */
|
||||
|
||||
#ifndef _OPENSSL_WRAPPER_H_
|
||||
#define _OPENSSL_WRAPPER_H_
|
||||
@@ -40,6 +40,14 @@
|
||||
#undef X509_NAME // Again for Windows - conflict with WinCrypt.h.
|
||||
#endif
|
||||
|
||||
#include <gnutls/openssl.h>
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__) || (defined(__FreeBSD__)
|
||||
// For BSD-Systems, we assume that OpenSSL is part of the operating system.
|
||||
#include <openssl/md5.h>
|
||||
#include <openssl/rand.h>
|
||||
#else
|
||||
// For all other systems, we use GnuTLS.
|
||||
#include <gnutls/openssl.h>
|
||||
#define PKTH_USE_GNUTLS
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
#include <net/socket_startup.h>
|
||||
#include <net/socket_helper.h>
|
||||
#include <core/openssl_wrapper.h>
|
||||
|
||||
#ifdef PKTH_USE_GNUTLS
|
||||
|
||||
#include <gcrypt.h>
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/version.hpp> // solve compatibility issues
|
||||
@@ -62,12 +65,15 @@ extern "C" {
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
}
|
||||
#endif // PKTH_USE_GNUTLS
|
||||
|
||||
bool
|
||||
internal_socket_startup()
|
||||
{
|
||||
#ifdef PKTH_USE_GNUTLS
|
||||
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_boost);
|
||||
gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
#endif
|
||||
return SSL_library_init() == 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user