Changeset - 719e5d2dc018
[Not reviewed]
0 5 0
Joel Reymont - 12 years ago 2013-07-10 17:20:59
joelr1@gmail.com
build on the mac
5 files changed with 17 insertions and 5 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -8,25 +8,25 @@
 

	
 
#include "purple.h"
 
#include <algorithm>
 
#include <iostream>
 

	
 
#include "transport/networkplugin.h"
 
#include "transport/logging.h"
 
#include "transport/config.h"
 
#include "transport/logging.h"
 
#include "geventloop.h"
 

	
 
// #include "valgrind/memcheck.h"
 
#ifndef __FreeBSD__
 
#if !defined(__FreeBSD__) && !defined(__APPLE__)
 
#include "malloc.h"
 
#endif
 
#include <algorithm>
 
#include "errno.h"
 
#include <boost/make_shared.hpp>
 

	
 
#ifdef WITH_LIBEVENT
 
#include <event.h>
 
#endif
 

	
 
#ifdef WIN32
 
#include "win32/win32dep.h"
 
@@ -408,25 +408,25 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
 
					std::string data = stringOf(purple_account_get_int_wrapped(account, "version", 0));
 
					g_file_set_contents ("gfire.cfg", data.c_str(), data.size(), NULL);
 
				}
 
// 				VALGRIND_DO_LEAK_CHECK;
 
				m_sessions.erase(user);
 
				purple_account_disconnect_wrapped(account);
 
				purple_account_set_enabled_wrapped(account, "spectrum", FALSE);
 

	
 
				m_accounts.erase(account);
 

	
 
				purple_accounts_delete_wrapped(account);
 
#ifndef WIN32
 
#ifndef __FreeBSD__
 
#if !defined(__FreeBSD__) && !defined(__APPLE__)
 
				malloc_trim(0);
 
#endif
 
#endif
 
// 				VALGRIND_DO_LEAK_CHECK;
 
			}
 
		}
 

	
 
		void handleStatusChangeRequest(const std::string &user, int status, const std::string &statusMessage) {
 
			PurpleAccount *account = m_sessions[user];
 
			if (account) {
 
				int st;
 
				switch(status) {
 
@@ -1574,25 +1574,25 @@ static PurpleCoreUiOps coreUiOps =
 
	transport_core_ui_init,
 
	NULL,
 
	spectrum_ui_get_info,
 
	NULL,
 
	NULL,
 
	NULL
 
};
 

	
 
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
 
#endif
 

	
 
	// For prpl-gg
 
	execute_purple_plugin_action(gc, "Download buddylist from Server");
 
}
 

	
 
static void printDebug(PurpleDebugLevel level, const char *category, const char *arg_s) {
 
	std::string c("");
 
	std::string args(arg_s);
 
@@ -1773,25 +1773,25 @@ static void transportDataReceived(gpointer data, gint source, PurpleInputConditi
 
	}
 
	else {
 
		if (writeInput != 0) {
 
			purple_input_remove_wrapped(writeInput);
 
			writeInput = 0;
 
		}
 
		np->readyForData();
 
	}
 
}
 

	
 
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
 

	
 
		signal(SIGPIPE, SIG_IGN);
 

	
 
		if (signal(SIGCHLD, spectrum_sigchld_handler) == SIG_ERR) {
 
			std::cout << "SIGCHLD handler can't be set\n";
 
			return -1;
 
		}
 
#endif
 

	
backends/libyahoo2/yahoo/crypt.c
Show inline comments
 
@@ -17,24 +17,28 @@
 
   License along with the GNU C Library; if not, write to the Free
 
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
   02111-1307 USA.  */
 

	
 
/* warmenhoven took this file and made it work with the md5.[ch] we
 
 * already had. isn't that lovely. people should just use linux or
 
 * freebsd, crypt works properly on those systems. i hate solaris */
 

	
 
#if HAVE_CONFIG_H
 
# include <config.h>
 
#endif
 

	
 
#ifdef __APPLE__
 
#define HAVE_STRING_H 1
 
#endif
 

	
 
#if HAVE_STRING_H
 
#  include <string.h>
 
#elif HAVE_STRINGS_H
 
#  include <strings.h>
 
#endif
 

	
 
#include <stdlib.h>
 
#include "yahoo_util.h"
 

	
 
#include "md5.h"
 

	
 
/* Define our magic string to mark salt for MD5 "encryption"
backends/libyahoo2/yahoo/libyahoo2.c
Show inline comments
 
@@ -42,24 +42,28 @@
 
 * GNU General Public License for more details.
 
 *
 
 * You should have received a copy of the GNU General Public License
 
 * along with this program; if not, write to the Free Software
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 *
 
 */
 

	
 
#if HAVE_CONFIG_H
 
# include <config.h>
 
#endif
 

	
 
#if __APPLE__
 
#define STDC_HEADERS 1
 
#endif
 

	
 
#if HAVE_UNISTD_H
 
#include <unistd.h>
 
#endif
 
#include <errno.h>
 
#include <stdio.h>
 
#include <stdarg.h>
 

	
 
#if STDC_HEADERS
 
# include <string.h>
 
#else
 
# if !HAVE_STRCHR
 
#  define strchr index
backends/libyahoo2/yahoo/yahoo_util.c
Show inline comments
 
@@ -14,24 +14,28 @@
 
 * GNU General Public License for more details.
 
 *
 
 * You should have received a copy of the GNU General Public License
 
 * along with this program; if not, write to the Free Software
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 *
 
 */
 

	
 
#if HAVE_CONFIG_H
 
# include <config.h>
 
#endif
 

	
 
#if __APPLE__
 
#define STDC_HEADERS 1
 
#endif
 

	
 
#if STDC_HEADERS
 
# include <string.h>
 
#else
 
# if !HAVE_STRCHR
 
#  define strchr index
 
#  define strrchr rindex
 
# endif
 
char *strchr(), *strrchr();
 
# if !HAVE_MEMCPY
 
#  define memcpy(d, s, n) bcopy ((s), (d), (n))
 
#  define memmove(d, s, n) bcopy ((s), (d), (n))
 
# endif
backends/libyahoo2/yahoo/yahoo_util.h
Show inline comments
 
@@ -55,25 +55,25 @@
 
# include <stdarg.h>
 

	
 
# define FREE(x)		if(x) {free(x); x=NULL;}
 

	
 
# define y_new(type, n)		(type *)malloc(sizeof(type) * (n))
 
# define y_new0(type, n)	(type *)calloc((n), sizeof(type))
 
# define y_renew(type, mem, n)	(type *)realloc(mem, n)
 

	
 
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);
 

	
 
char *strdup(const char *s);
 

	
 
int snprintf(char *str, size_t size, const char *format, ...);
 
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
 
#endif
 

	
 
#endif
 

	
 
#ifndef TRUE
0 comments (0 inline, 0 general)