From f1c5ff3ba23d3d478218d39bb3ac4a5de26d2070 Mon Sep 17 00:00:00 2001 From: lotodore Date: Mon, 16 Feb 2009 20:14:12 +0000 Subject: [PATCH] BSD related fixes. Thanks to coldz. --- src/core/linux/convhelper.cpp | 8 ++++++-- src/core/openssl_wrapper.h | 8 ++++++-- src/third_party/libircclient/include/config.h | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/core/linux/convhelper.cpp b/src/core/linux/convhelper.cpp index 2368192a..5ed77752 100644 --- a/src/core/linux/convhelper.cpp +++ b/src/core/linux/convhelper.cpp @@ -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 #include @@ -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(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(inStr.data()); diff --git a/src/core/openssl_wrapper.h b/src/core/openssl_wrapper.h index 8721ccb9..9973a08d 100644 --- a/src/core/openssl_wrapper.h +++ b/src/core/openssl_wrapper.h @@ -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 #include #include diff --git a/src/third_party/libircclient/include/config.h b/src/third_party/libircclient/include/config.h index 47fe2bb6..003da870 100644 --- a/src/third_party/libircclient/include/config.h +++ b/src/third_party/libircclient/include/config.h @@ -2,7 +2,7 @@ /* include/config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `gethostbyname_r' function. */ -#if !defined(__APPLE__) && !defined(__OpenBSD__) +#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__NetBSD__) #define HAVE_GETHOSTBYNAME_R 1 #endif