/pidgin/main: ed4fd1030878: cross-win32: fix libpurple code warn...
Tomasz Wasilczyk
twasilczyk at pidgin.im
Tue Apr 15 17:40:59 EDT 2014
Changeset: ed4fd1030878c8708379f3938e2ecfde8e3aa218
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2014-04-15 23:40 +0200
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/ed4fd1030878
Description:
cross-win32: fix libpurple code warnings and errors
diffstat:
configure.ac | 6 ++++++
libpurple/Makefile.am | 12 ++++++++++++
libpurple/dbus-server.h | 2 ++
libpurple/dnsquery.c | 4 +++-
libpurple/dnssrv.c | 2 +-
libpurple/plugins/dbus-example.c | 8 ++++----
libpurple/prefs.c | 4 ----
libpurple/protocols/gg/lib/fileio.h | 6 ++++++
libpurple/win32/giowin32.c | 8 ++++----
9 files changed, 38 insertions(+), 14 deletions(-)
diffs (189 lines):
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1385,6 +1385,9 @@ fi
if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc//'`
fi
+if test "x$is_win32" = "xyes" ; then
+ STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/zephyr//'`
+fi
AC_SUBST(STATIC_PRPLS)
STATIC_LINK_LIBS=
extern_init=
@@ -1462,6 +1465,9 @@ fi
if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc//'`
fi
+if test "x$is_win32" = "xyes" ; then
+ DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/zephyr//'`
+fi
AC_SUBST(DYNAMIC_PRPLS)
for i in $DYNAMIC_PRPLS ; do
case $i in
diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -206,6 +206,18 @@ purple_coreheaders = \
xfer.h \
xmlnode.h
+if IS_WIN32
+purple_coresources += \
+ win32/giowin32.c \
+ win32/libc_interface.c \
+ win32/win32dep.c
+purple_coreheaders += \
+ win32/libc_interface.h \
+ win32/libc_internal.h \
+ win32/win32dep.h \
+ win32/wpurpleerror.h
+endif
+
purple_mediaheaders = \
backend-iface.h \
candidate.h \
diff --git a/libpurple/dbus-server.h b/libpurple/dbus-server.h
--- a/libpurple/dbus-server.h
+++ b/libpurple/dbus-server.h
@@ -209,7 +209,9 @@ void purple_dbus_uninit(void);
* dbus-analyze-functions.py is run without the "--export-only" option,
* this prefix is ignored.
*/
+#ifndef DBUS_EXPORT
#define DBUS_EXPORT
+#endif
/*
Here we include the list of #PURPLE_DBUS_DECLARE_TYPE statements for
diff --git a/libpurple/dnsquery.c b/libpurple/dnsquery.c
--- a/libpurple/dnsquery.c
+++ b/libpurple/dnsquery.c
@@ -729,8 +729,10 @@ static gpointer
dns_thread(gpointer data)
{
PurpleDnsQueryData *query_data;
+#if defined(HAVE_GETADDRINFO) || defined(USE_IDN)
+ int rc;
+#endif
#ifdef HAVE_GETADDRINFO
- int rc;
struct addrinfo hints, *res, *tmp;
char servname[20];
#else
diff --git a/libpurple/dnssrv.c b/libpurple/dnssrv.c
--- a/libpurple/dnssrv.c
+++ b/libpurple/dnssrv.c
@@ -702,7 +702,7 @@ res_thread(gpointer data)
txtres = g_new0(PurpleTxtResponse, 1);
s = g_string_new("");
- for (i = 0; i < txt_data->dwStringCount; ++i)
+ for (i = 0; i < (int)txt_data->dwStringCount; ++i)
s = g_string_append(s, txt_data->pStringArray[i]);
txtres->content = g_string_free(s, FALSE);
diff --git a/libpurple/plugins/dbus-example.c b/libpurple/plugins/dbus-example.c
--- a/libpurple/plugins/dbus-example.c
+++ b/libpurple/plugins/dbus-example.c
@@ -79,12 +79,12 @@ DBUS_EXPORT const char *dbus_example_get
static PurpleText hello;
/* Here come the definitions of the four exported functions. */
-PurpleText* dbus_example_get_hello_object(void)
+DBUS_EXPORT PurpleText* dbus_example_get_hello_object(void)
{
return &hello;
}
-void dbus_example_set_text(PurpleText *obj, const char *text)
+DBUS_EXPORT void dbus_example_set_text(PurpleText *obj, const char *text)
{
if (obj != NULL) {
g_free(obj->text);
@@ -92,7 +92,7 @@ void dbus_example_set_text(PurpleText *o
}
}
-const char *dbus_example_get_text(PurpleText *obj)
+DBUS_EXPORT const char *dbus_example_get_text(PurpleText *obj)
{
if (obj != NULL)
return obj->text;
@@ -100,7 +100,7 @@ const char *dbus_example_get_text(Purple
return NULL;
}
-const char *dbus_example_get_buddy_name(PurpleBuddy *buddy)
+DBUS_EXPORT const char *dbus_example_get_buddy_name(PurpleBuddy *buddy)
{
return purple_buddy_get_name(buddy);
}
diff --git a/libpurple/prefs.c b/libpurple/prefs.c
--- a/libpurple/prefs.c
+++ b/libpurple/prefs.c
@@ -35,10 +35,6 @@
#include "debug.h"
#include "util.h"
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
struct pref_cb {
PurplePrefCallback func;
gpointer data;
diff --git a/libpurple/protocols/gg/lib/fileio.h b/libpurple/protocols/gg/lib/fileio.h
--- a/libpurple/protocols/gg/lib/fileio.h
+++ b/libpurple/protocols/gg/lib/fileio.h
@@ -34,11 +34,17 @@
#ifdef _WIN32
# include <io.h>
# define gg_file_close _close
+# undef lseek
# define lseek _lseek
+# undef open
# define open _open
+# undef read
# define read _read
+# undef stat
# define stat _stat
+# undef fstat
# define fstat _fstat
+# undef write
# define write _write
# define S_IRWXO 0
# define S_IRWXG 0
diff --git a/libpurple/win32/giowin32.c b/libpurple/win32/giowin32.c
--- a/libpurple/win32/giowin32.c
+++ b/libpurple/win32/giowin32.c
@@ -222,7 +222,7 @@ init_reset_sockets (GIOWin32Channel *cha
int len;
channel->reset_send = (gint) socket (AF_INET, SOCK_DGRAM, 0);
- if (channel->reset_send == INVALID_SOCKET)
+ if (channel->reset_send == (gint)INVALID_SOCKET)
{
g_warning (G_STRLOC ": Error creating reset_send socket: %s\n",
g_win32_error_message (WSAGetLastError ()));
@@ -243,7 +243,7 @@ init_reset_sockets (GIOWin32Channel *cha
local2.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
channel->reset_recv = (gint) socket (AF_INET, SOCK_DGRAM, 0);
- if (channel->reset_recv == INVALID_SOCKET)
+ if (channel->reset_recv == (gint)INVALID_SOCKET)
{
g_warning (G_STRLOC ": Error creating reset_recv socket: %s\n",
g_win32_error_message (WSAGetLastError ()));
@@ -603,9 +603,9 @@ g_io_win32_free (GIOChannel *channel)
win32_channel->thread_id,
win32_channel->fd);
- if (win32_channel->reset_send && win32_channel->reset_send != INVALID_SOCKET)
+ if (win32_channel->reset_send && win32_channel->reset_send != (gint)INVALID_SOCKET)
closesocket (win32_channel->reset_send);
- if (win32_channel->reset_recv && win32_channel->reset_recv != INVALID_SOCKET)
+ if (win32_channel->reset_recv && win32_channel->reset_recv != (gint)INVALID_SOCKET)
closesocket (win32_channel->reset_recv);
if (win32_channel->data_avail_event)
CloseHandle (win32_channel->data_avail_event);
More information about the Commits
mailing list