From 719e5d2dc0186a40826e5f0ccb790442cb65fa3b Mon Sep 17 00:00:00 2001 From: Joel Reymont Date: Wed, 10 Jul 2013 16:20:59 +0100 Subject: [PATCH] build on the mac --- backends/libpurple/main.cpp | 8 ++++---- backends/libyahoo2/yahoo/crypt.c | 6 +++++- backends/libyahoo2/yahoo/libyahoo2.c | 4 ++++ backends/libyahoo2/yahoo/yahoo_util.c | 4 ++++ backends/libyahoo2/yahoo/yahoo_util.h | 2 +- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/backends/libpurple/main.cpp b/backends/libpurple/main.cpp index 182e21c2..c5c85adb 100644 --- a/backends/libpurple/main.cpp +++ b/backends/libpurple/main.cpp @@ -17,7 +17,7 @@ #include "geventloop.h" // #include "valgrind/memcheck.h" -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__APPLE__) #include "malloc.h" #endif #include @@ -417,7 +417,7 @@ class SpectrumNetworkPlugin : public NetworkPlugin { purple_accounts_delete_wrapped(account); #ifndef WIN32 -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__APPLE__) malloc_trim(0); #endif #endif @@ -1583,7 +1583,7 @@ static void signed_on(PurpleConnection *gc, gpointer unused) { PurpleAccount *account = purple_connection_get_account_wrapped(gc); np->handleConnected(np->m_accounts[account]); #ifndef WIN32 -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__APPLE__) // force returning of memory chunks allocated by libxml2 to kernel malloc_trim(0); #endif @@ -1782,7 +1782,7 @@ static void transportDataReceived(gpointer data, gint source, PurpleInputConditi int main(int argc, char **argv) { #ifndef WIN32 -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__APPLE__) mallopt(M_CHECK_ACTION, 2); mallopt(M_PERTURB, 0xb); #endif diff --git a/backends/libyahoo2/yahoo/crypt.c b/backends/libyahoo2/yahoo/crypt.c index 9e215d8a..1483ac46 100644 --- a/backends/libyahoo2/yahoo/crypt.c +++ b/backends/libyahoo2/yahoo/crypt.c @@ -23,7 +23,11 @@ * freebsd, crypt works properly on those systems. i hate solaris */ #if HAVE_CONFIG_H -# include +# include +#endif + +#ifdef __APPLE__ +#define HAVE_STRING_H 1 #endif #if HAVE_STRING_H diff --git a/backends/libyahoo2/yahoo/libyahoo2.c b/backends/libyahoo2/yahoo/libyahoo2.c index f33f1365..46b487cc 100644 --- a/backends/libyahoo2/yahoo/libyahoo2.c +++ b/backends/libyahoo2/yahoo/libyahoo2.c @@ -51,6 +51,10 @@ # include #endif +#if __APPLE__ +#define STDC_HEADERS 1 +#endif + #if HAVE_UNISTD_H #include #endif diff --git a/backends/libyahoo2/yahoo/yahoo_util.c b/backends/libyahoo2/yahoo/yahoo_util.c index add6d81a..92e8d31e 100644 --- a/backends/libyahoo2/yahoo/yahoo_util.c +++ b/backends/libyahoo2/yahoo/yahoo_util.c @@ -23,6 +23,10 @@ # include #endif +#if __APPLE__ +#define STDC_HEADERS 1 +#endif + #if STDC_HEADERS # include #else diff --git a/backends/libyahoo2/yahoo/yahoo_util.h b/backends/libyahoo2/yahoo/yahoo_util.h index cc924867..03efd716 100644 --- a/backends/libyahoo2/yahoo/yahoo_util.h +++ b/backends/libyahoo2/yahoo/yahoo_util.h @@ -64,7 +64,7 @@ void *y_memdup(const void *addr, int n); char **y_strsplit(char *str, char *sep, int nelem); void y_strfreev(char **vector); -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__APPLE__) int strncasecmp(const char *s1, const char *s2, size_t n); int strcasecmp(const char *s1, const char *s2);