BSD related fixes. Thanks to coldz.
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
#error This file is not for Windows.
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#define HAVE_ICONV_CONST
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
@@ -37,7 +41,7 @@ ConvHelper::NativeToUtf8(const std::string &inStr)
|
||||
{
|
||||
string retStr(inStr);
|
||||
size_t insize = inStr.length();
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||
#ifdef HAVE_ICONV_CONST
|
||||
const char *inbuf = inStr.data();
|
||||
#else
|
||||
char *inbuf = const_cast<char *>(inStr.data());
|
||||
@@ -72,7 +76,7 @@ ConvHelper::Utf8ToNative(const std::string &inStr)
|
||||
{
|
||||
string retStr(inStr);
|
||||
size_t insize = inStr.length();
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||
#ifdef HAVE_ICONV_CONST
|
||||
const char *inbuf = inStr.data();
|
||||
#else
|
||||
char *inbuf = const_cast<char *>(inStr.data());
|
||||
|
||||
@@ -40,8 +40,12 @@
|
||||
#undef X509_NAME // Again for Windows - conflict with WinCrypt.h.
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
|
||||
// For BSD-Systems, we assume that OpenSSL is part of the operating system.
|
||||
// For BSD-Systems, we assume that OpenSSL is part of the operating system.
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#define HAVE_OPENSSL
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENSSL
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/md5.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
Reference in New Issue
Block a user