changeset 22528:322b92e28005

Add extern "C" wrappers to win32 headers. There is also a change here that I thought I committed earlier that should provide better error messages for winsock errors.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 24 Mar 2008 16:11:21 +0000
parents 217fffe3f46f
children d93577159f2a
files libpurple/win32/libc_interface.h libpurple/win32/libc_internal.h libpurple/win32/win32dep.h pidgin/win32/untar.h pidgin/win32/wspell.h
diffstat 5 files changed, 43 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/win32/libc_interface.h	Mon Mar 24 07:14:29 2008 +0000
+++ b/libpurple/win32/libc_interface.h	Mon Mar 24 16:11:21 2008 +0000
@@ -29,6 +29,10 @@
 #include "libc_internal.h"
 #include <glib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
 #ifdef _MSC_VER
 #define S_IRUSR S_IREAD
 #define S_IWUSR S_IWRITE
@@ -98,6 +102,8 @@
 wpurple_strerror( errno )
 #define strerror( errornum ) \
 wpurple_strerror( errornum )
+#define g_strerror( errornum ) \
+wpurple_strerror( errornum )
 
 /* unistd.h */
 #define read( fd, buf, buflen ) \
@@ -153,4 +159,8 @@
 /* helper for purple_utf8_strftime() by way of purple_internal_strftime() in src/util.c */
 const char *wpurple_get_timezone_abbreviation(const struct tm *tm);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* _LIBC_INTERFACE_H_ */
--- a/libpurple/win32/libc_internal.h	Mon Mar 24 07:14:29 2008 +0000
+++ b/libpurple/win32/libc_internal.h	Mon Mar 24 16:11:21 2008 +0000
@@ -25,6 +25,10 @@
 #include <glib.h>
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
 /* sys/socket.h */
 int wpurple_socket(int namespace, int style, int protocol);
 int wpurple_connect(int socket, struct sockaddr *addr, u_long length);
@@ -137,4 +141,8 @@
 /* stdio.h */
 int wpurple_rename(const char *oldname, const char *newname);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* _LIBC_INTERNAL_ */
--- a/libpurple/win32/win32dep.h	Mon Mar 24 07:14:29 2008 +0000
+++ b/libpurple/win32/win32dep.h	Mon Mar 24 16:11:21 2008 +0000
@@ -28,10 +28,12 @@
 #include "wpurpleerror.h"
 #include "libc_interface.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
 /* rpcndr.h defines small as char, causing problems, so we need to undefine it */
-#ifdef _WIN32
 #undef small
-#endif
 
 /*
  *  PROTOS
@@ -50,7 +52,7 @@
 gboolean wpurple_check_for_proxy_changes(void);
 
 /* Determine Purple paths */
-char *wpurple_get_special_folder(int folder_type); /* needs to be g_free'd */
+gchar *wpurple_get_special_folder(int folder_type); /* needs to be g_free'd */
 const char *wpurple_install_dir(void);
 const char *wpurple_lib_dir(void);
 const char *wpurple_locale_dir(void);
@@ -73,5 +75,9 @@
 #define LIBDIR wpurple_lib_dir()
 #define LOCALEDIR wpurple_locale_dir()
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* _WIN32DEP_H_ */
 
--- a/pidgin/win32/untar.h	Mon Mar 24 07:14:29 2008 +0000
+++ b/pidgin/win32/untar.h	Mon Mar 24 16:11:21 2008 +0000
@@ -8,6 +8,10 @@
 #ifndef _UNTAR_H_
 #define _UNTAR_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
 typedef enum _untar_opt {
 	UNTAR_LISTING =      (1 << 0),
 	UNTAR_QUIET =        (1 << 1),
@@ -19,4 +23,8 @@
 
 int untar(const char *filename, const char *destdir, untar_opt options);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif
--- a/pidgin/win32/wspell.h	Mon Mar 24 07:14:29 2008 +0000
+++ b/pidgin/win32/wspell.h	Mon Mar 24 16:11:21 2008 +0000
@@ -24,6 +24,10 @@
 #define _WSPELL_H_
 #include <gtkspell/gtkspell.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
 void winpidgin_spell_init(void);
 
 extern GtkSpell* (*wpidginspell_new_attach)(GtkTextView*, const gchar*, GError**);
@@ -46,4 +50,8 @@
 #define gtkspell_recheck_all( spell ) \
 wpidginspell_recheck_all( spell )
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* _WSPELL_H_ */