/pidgin/main: 6af7f9a6859f: Merge with release-2.x.y with a few ...

Daniel Atallah <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 6af7f9a6859fd2b7ee3df08cea2c438489c80057
Author:	 Daniel Atallah <[email protected]>
Date:	 2014-12-16 18:18 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/6af7f9a6859f

Description:

Merge with release-2.x.y with a few manual conflict resolutions

diffstat:

 libpurple/protocols/bonjour/Makefile.mingw |   7 -------
 libpurple/protocols/bonjour/dns_sd_proxy.h |  17 ++---------------
 libpurple/protocols/gg/lib/events.c        |   2 +-
 libpurple/protocols/gg/libgaduw.c          |  13 ++++++++-----
 libpurple/win32/global.mak                 |   1 -
 5 files changed, 11 insertions(+), 29 deletions(-)

diffs (128 lines):

diff --git a/libpurple/protocols/bonjour/Makefile.mingw b/libpurple/protocols/bonjour/Makefile.mingw
--- a/libpurple/protocols/bonjour/Makefile.mingw
+++ b/libpurple/protocols/bonjour/Makefile.mingw
@@ -29,7 +29,6 @@ INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(BONJOUR_TOP)/Include \
 			-I$(LIBXML2_TOP)/include/libxml2 \
 			-I$(PURPLE_TOP) \
 			-I$(PURPLE_TOP)/win32 \
@@ -65,12 +64,6 @@ LIBS =	\
 			-lxml2 \
 			-lpurple
 
-ifeq ($(LINK_DNS_SD_DIRECTLY), 1)
-	CFLAGS += -DLINK_DNS_SD_DIRECTLY
-	LIB_PATHS += -L$(BONJOUR_TOP)/lib/win32 -L$(BONJOUR_TOP)/lib
-	LIBS += -ldnssd
-endif
-
 include $(PIDGIN_COMMON_RULES)
 
 ##
diff --git a/libpurple/protocols/bonjour/dns_sd_proxy.h b/libpurple/protocols/bonjour/dns_sd_proxy.h
--- a/libpurple/protocols/bonjour/dns_sd_proxy.h
+++ b/libpurple/protocols/bonjour/dns_sd_proxy.h
@@ -27,10 +27,8 @@
 #include <stdint.h>
 #endif
 
-#ifdef IS_WIN32_CROSS_COMPILED
-
-/* I'm not sure, if we really need to include this for the following definitions
- * modeled after Apple's dns_sd.h file.
+/* The following is a subset of Apple's dns_sd.h file
+ * http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-333.10/mDNSShared/dns_sd.h
  *
  * Copyright (c) 2003-2004, Apple Computer, Inc. All rights reserved.
  *
@@ -115,18 +113,9 @@ enum {
 	kDNSServiceProtocol_IPv4 = 0x01,
 };
 
-#else
-/* fixup to make pidgin compile against win32 bonjour */
-#  if defined(_WIN32) && !defined(_MSC_VER)
-#    define _MSL_STDINT_H
-#  endif
-#  include <dns_sd.h>
-#endif /* IS_WIN32_CROSS_COMPILED */
 
 gboolean dns_sd_available(void);
 
-#ifndef LINK_DNS_SD_DIRECTLY
-
 DNSServiceErrorType _wpurple_DNSServiceAddRecord(DNSServiceRef sdRef, DNSRecordRef *RecordRef, DNSServiceFlags flags,
 	uint16_t rrtype, uint16_t rdlen, const void *rdata, uint32_t ttl);
 #define DNSServiceAddRecord(sdRef, RecordRef, flags, rrtype, rdlen, rdata, ttl) \
@@ -207,6 +196,4 @@ DNSServiceErrorType _wpurple_TXTRecordSe
 #define TXTRecordSetValue(txtRecord, key, valueSize, value) \
 	_wpurple_TXTRecordSetValue(txtRecord, key, valueSize, value)
 
-#endif /*LINK_DNS_SD_DIRECTLY*/
-
 #endif
diff --git a/libpurple/protocols/gg/lib/events.c b/libpurple/protocols/gg/lib/events.c
--- a/libpurple/protocols/gg/lib/events.c
+++ b/libpurple/protocols/gg/lib/events.c
@@ -971,7 +971,7 @@ static gg_action_t gg_handle_reading_hub
 	struct gg_event *e, enum gg_state_t next_state,
 	enum gg_state_t alt_state, enum gg_state_t alt2_state)
 {
-	char buf[1024], *tmp, host[128];
+	char buf[1024], *tmp, host[129];
 	int port = GG_DEFAULT_PORT;
 	int reply;
 	const char *body;
diff --git a/libpurple/protocols/gg/libgaduw.c b/libpurple/protocols/gg/libgaduw.c
--- a/libpurple/protocols/gg/libgaduw.c
+++ b/libpurple/protocols/gg/libgaduw.c
@@ -69,7 +69,8 @@ static void ggp_libgaduw_debug_handler(i
 	va_list args)
 {
 	PurpleDebugLevel purple_level;
-	char *msg;
+	char msgbuff[1000];
+	int ret;
 
 	if ((level & GG_DEBUG_NET) || (level & GG_DEBUG_FUNCTION) ||
 		(level & GG_DEBUG_VERBOSE))
@@ -85,11 +86,13 @@ static void ggp_libgaduw_debug_handler(i
 			return;
 	}
 
-	msg = g_strdup_vprintf(format, args);
+	/* Don't use glib's printf family, since it might not support
+	 * system-specific formatting modifiers (like %Iu for size on win32). */
+	ret = vsnprintf(msgbuff, sizeof(msgbuff) / sizeof(char), format, args);
 
-	if (!msg) {
+	if (ret <= 0) {
 		purple_debug_fatal("gg",
-			"failed to vprintf the following message: %s",
+			"failed to printf the following message: %s",
 			format ? format : "(null)\n");
 
 		return;
@@ -102,7 +105,7 @@ static void ggp_libgaduw_debug_handler(i
 	else
 		purple_level = PURPLE_DEBUG_MISC;
 
-	purple_debug(purple_level, "gg", "%s", msg);
+	purple_debug(purple_level, "gg", "%s", msgbuff);
 	g_free(msg);
 }
 
diff --git a/libpurple/win32/global.mak b/libpurple/win32/global.mak
--- a/libpurple/win32/global.mak
+++ b/libpurple/win32/global.mak
@@ -21,7 +21,6 @@ ENCHANT_TOP ?= $(WIN32_DEV_TOP)/enchant-
 GNUTLS_TOP ?= $(WIN32_DEV_TOP)/gnutls-3.1
 GTK_TOP ?= $(WIN32_DEV_TOP)/gtk2-2.24
 GTK_BIN ?= $(GTK_TOP)/bin
-BONJOUR_TOP ?= $(WIN32_DEV_TOP)/bonjour-sdk
 JSON_GLIB_TOP ?= $(WIN32_DEV_TOP)/json-glib-0.14
 LIBXML2_TOP ?= $(WIN32_DEV_TOP)/libxml2-2.9
 MEANWHILE_TOP ?= $(WIN32_DEV_TOP)/meanwhile-1.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.