BSD related fixes. Thanks to coldz.

This commit is contained in:
lotodore
2009-02-16 20:14:12 +00:00
parent 24c0ceb7b6
commit f1c5ff3ba2
3 changed files with 13 additions and 5 deletions
+6 -2
View File
@@ -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());
+6 -2
View File
@@ -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>