Bug 1189247 - Fix Windows bustage from bug 964828. r=florian
authorPatrick Cloke <clokep>
Mon, 10 Aug 2015 04:34:00 -0400
changeset 778 cfb3392fcd203413bf8de1d48a721167edf6dffe
parent 777 21c486b08ddaadd49469324fca986cdb84b6aca5
child 779 45eb4fb2d037835b5a234d428baaaa0b6fe0df89
push id54
push userclokep@gmail.com
push dateMon, 10 Aug 2015 15:24:07 +0000
reviewersflorian
bugs1189247, 964828
Bug 1189247 - Fix Windows bustage from bug 964828. r=florian
libpurple/protocols/gg/lib/config.h
libpurple/protocols/gg/lib/network.h
libpurple/protocols/gg/moz.build
libpurple/protocols/msn/msn.c
libpurple/protocols/msn/notification.c
libpurple/protocols/msn/slpcall.c
libpurple/protocols/sipe/moz.build
--- a/libpurple/protocols/gg/lib/config.h
+++ b/libpurple/protocols/gg/lib/config.h
@@ -86,8 +86,13 @@
 #define GG_CONFIG_IS_GPL_COMPLIANT
 
 /* Defined if libgadu uses system defalt trusted CAs. */
 #define GG_CONFIG_SSL_SYSTEM_TRUST
 
 /* Defined if libgadu is GPL compliant (was not linked with OpenSSL or any
    other non-GPL compliant library support). */
 #define GG_CONFIG_IS_GPL_COMPLIANT
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#define strncasecmp strnicmp
+#endif
--- a/libpurple/protocols/gg/lib/network.h
+++ b/libpurple/protocols/gg/lib/network.h
@@ -24,16 +24,17 @@
  *
  * \brief Makra zapewniające kompatybilność API do obsługi sieci na różnych systemach
  */
 
 #ifndef LIBGADU_NETWORK_H
 #define LIBGADU_NETWORK_H
 
 #ifdef _WIN32
+#  include <io.h>
 #  include <ws2tcpip.h>
 #  include <winsock2.h>
 #  include <stdlib.h>
 #  include <stdio.h>
 #  include <errno.h>
 /* Obecnie na Win32 tylko MSVC definiuje te typy błędów. Na wypadek, gdyby
  * jednak Cygwin bądź MinGW zaczęły je definiować, używamy bardziej ogólnych
  * ifdefów. */
--- a/libpurple/protocols/gg/moz.build
+++ b/libpurple/protocols/gg/moz.build
@@ -28,15 +28,20 @@ SOURCES += [
     'lib/pubdir50.c',
     'lib/resolver.c',
     'lib/sha1.c',
     'lib/tvbuff.c',
     'lib/tvbuilder.c',
     'search.c',
 ]
 
+if CONFIG['OS_TARGET'] == 'WINNT':
+    DEFINES['inline'] = '__inline'
+    # Get rid of a ton of warnings.
+    DEFINES['_WINSOCK_DEPRECATED_NO_WARNINGS'] = ''
+
 USE_LIBS += [
     'zlib',
 ]
 
 protocol = 'gg'
 
 include('../prpl.py')
--- a/libpurple/protocols/msn/msn.c
+++ b/libpurple/protocols/msn/msn.c
@@ -534,17 +534,17 @@ msn_show_locations(PurplePluginAction *a
 
 	group = purple_request_field_group_new(_("Other Locations"));
 	purple_request_fields_add_group(fields, group);
 
 	have_other_endpoints = FALSE;
 	for (l = session->user->endpoints; l; l = l->next) {
 		MsnUserEndpoint *ep = l->data;
 
-		if (ep->id[0] != '\0' && strncasecmp(ep->id + 1, session->guid, 36) == 0)
+		if (ep->id[0] != '\0' && g_ascii_strncasecmp(ep->id + 1, session->guid, 36) == 0)
 			/* Don't add myself to the list */
 			continue;
 
 		if (!have_other_endpoints) {
 			/* We do in fact have an endpoint other than ourselves... let's
 			   add a label */
 			field = purple_request_field_label_new("others-label",
 					_("You can sign out from other locations here"));
@@ -603,17 +603,17 @@ disable_mpop_cb(PurpleConnection *pc)
 
 	session->enable_mpop = FALSE;
 	msn_annotate_contact(session, "Me", "MSN.IM.MPOP", "0", NULL);
 
 	for (l = session->user->endpoints; l; l = l->next) {
 		MsnUserEndpoint *ep = l->data;
 		char *user;
 
-		if (ep->id[0] != '\0' && strncasecmp(ep->id + 1, session->guid, 36) == 0)
+		if (ep->id[0] != '\0' && g_ascii_strncasecmp(ep->id + 1, session->guid, 36) == 0)
 			/* Don't kick myself */
 			continue;
 
 		purple_debug_info("msn", "Disconnecting Endpoint %s\n", ep->id);
 
 		user = g_strdup_printf("%s;%s", purple_account_get_username(account), ep->id);
 		msn_notification_send_uun(session, user, MSN_UNIFIED_NOTIFICATION_MPOP, "goawyplzthxbye");
 		g_free(user);
--- a/libpurple/protocols/msn/notification.c
+++ b/libpurple/protocols/msn/notification.c
@@ -1596,17 +1596,17 @@ parse_user_endpoints(MsnUser *user, xmln
 	     epNode;
 	     epNode = xmlnode_get_next_twin(epNode)) {
 		id = xmlnode_get_attrib(epNode, "id");
 		capsNode = xmlnode_get_child(epNode, "Capabilities");
 
 		/* Disconnect others, if MPOP is disabled */
 		if (is_me
 		 && !session->enable_mpop
-		 && strncasecmp(id + 1, session->guid, 36) != 0) {
+		 && g_ascii_strncasecmp(id + 1, session->guid, 36) != 0) {
 			purple_debug_info("msn", "Disconnecting Endpoint %s\n", id);
 
 			tmp = g_strdup_printf("%s;%s", user->passport, id);
 			msn_notification_send_uun(session, tmp, MSN_UNIFIED_NOTIFICATION_MPOP, "goawyplzthxbye");
 			g_free(tmp);
 		} else {
 			if (capsNode != NULL) {
 				caps = xmlnode_get_data(capsNode);
--- a/libpurple/protocols/msn/slpcall.c
+++ b/libpurple/protocols/msn/slpcall.c
@@ -323,17 +323,17 @@ msn_slp_process_transresp(MsnSlpCall *sl
 		/* Ok, the client supports direct TCP connection */
 
 		/* We always need this. */
 		if (ntype == DC_NONCE_SHA1) {
 			strncpy(dc->remote_nonce, nonce, 36);
 			dc->remote_nonce[36] = '\0';
 		}
 
-		if (!strcasecmp(listening, "false")) {
+		if (!g_ascii_strcasecmp(listening, "false")) {
 			if (dc->listen_data != NULL) {
 				/*
 				 * We'll listen for incoming connections but
 				 * the listening socket isn't ready yet so we cannot
 				 * send the INVITE packet now. Put the slpcall into waiting mode
 				 * and let the callback send the invite.
 				 */
 				slpcall->wait_for_socket = TRUE;
--- a/libpurple/protocols/sipe/moz.build
+++ b/libpurple/protocols/sipe/moz.build
@@ -84,15 +84,18 @@ elif CONFIG['GSSAPI']:
             'core/sip-sec-negotiate.c',
             'core/sip-sec-ntlm.c',
         ]
 
 if CONFIG['GSSAPI']:
     OS_LIBS += CONFIG['KRB5_LIBS'].split()
 
 USE_LIBS += [
-    'nspr',
     'nss',
 ]
+if not CONFIG['MOZ_FOLD_LIBS']:
+    USE_LIBS += [
+        'nspr',
+    ]
 
 protocol = 'sipe'
 
 include('../prpl.py')