From 3ac6cfaeaadc82ce7d8b9dba7134d5ea7272c70c Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sat, 10 Nov 2012 10:51:18 -0500 Subject: [PATCH] win32: prototype _glib_get_dll_directory() and _glib_get_locale_dir() Rather than using "extern" declarations of these win32 functions everywhere they're needed, just prototype them in glib-private.h. (Which also fixes the fact that they weren't prototyped in the files where they're defined.) https://bugzilla.gnome.org/show_bug.cgi?id=688109 --- gio/gdbus-tool.c | 10 ++++++++-- gio/glib-compile-resources.c | 5 ++++- gio/glib-compile-schemas.c | 5 ++++- gio/gresource-tool.c | 5 ++++- gio/gsettings-tool.c | 5 ++++- glib/ggettext.c | 1 + glib/glib-private.h | 5 +++++ glib/gspawn-win32.c | 2 +- 8 files changed, 31 insertions(+), 7 deletions(-) diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c index 6c4f3b1..bd71d1e 100644 --- a/gio/gdbus-tool.c +++ b/gio/gdbus-tool.c @@ -31,6 +31,10 @@ #include +#ifdef G_OS_WIN32 +#include "glib/glib-private.h" +#endif + /* ---------------------------------------------------------------------------------------------------- */ G_GNUC_UNUSED static void completion_debug (const gchar *format, ...); @@ -1927,13 +1931,15 @@ main (gint argc, gchar *argv[]) gboolean request_completion; gchar *completion_cur; gchar *completion_prev; +#ifdef G_OS_WIN32 + gchar *tmp; +#endif setlocale (LC_ALL, ""); textdomain (GETTEXT_PACKAGE); #ifdef G_OS_WIN32 - extern gchar *_glib_get_locale_dir (void); - gchar *tmp = _glib_get_locale_dir (); + tmp = _glib_get_locale_dir (); bindtextdomain (GETTEXT_PACKAGE, tmp); g_free (tmp); #else diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c index e0f994c..195237f 100644 --- a/gio/glib-compile-resources.c +++ b/gio/glib-compile-resources.c @@ -47,6 +47,10 @@ #include "gconstructor_as_data.h" +#ifdef G_OS_WIN32 +#include "glib/glib-private.h" +#endif + typedef struct { char *filename; @@ -625,7 +629,6 @@ main (int argc, char **argv) }; #ifdef G_OS_WIN32 - extern gchar *_glib_get_locale_dir (void); gchar *tmp; #endif diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c index bfac84a..41c5b76 100644 --- a/gio/glib-compile-schemas.c +++ b/gio/glib-compile-schemas.c @@ -36,6 +36,10 @@ #include "gvdb/gvdb-builder.h" #include "strinfo.c" +#ifdef G_OS_WIN32 +#include "glib/glib-private.h" +#endif + static void strip_string (GString *string) { @@ -2003,7 +2007,6 @@ main (int argc, char **argv) }; #ifdef G_OS_WIN32 - extern gchar *_glib_get_locale_dir (void); gchar *tmp; #endif diff --git a/gio/gresource-tool.c b/gio/gresource-tool.c index b38e407..d4e5699 100644 --- a/gio/gresource-tool.c +++ b/gio/gresource-tool.c @@ -40,6 +40,10 @@ #include #include +#ifdef G_OS_WIN32 +#include "glib/glib-private.h" +#endif + /* GResource functions {{{1 */ static GResource * get_resource (const gchar *file) @@ -583,7 +587,6 @@ main (int argc, char *argv[]) void (* function) (const gchar *, const gchar *, const gchar *, gboolean); #ifdef G_OS_WIN32 - extern gchar *_glib_get_locale_dir (void); gchar *tmp; #endif diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c index 764c3d7..c049ce0 100644 --- a/gio/gsettings-tool.c +++ b/gio/gsettings-tool.c @@ -27,6 +27,10 @@ #include #include +#ifdef G_OS_WIN32 +#include "glib/glib-private.h" +#endif + static gboolean contained (const gchar * const *items, const gchar *item) @@ -685,7 +689,6 @@ main (int argc, char **argv) const gchar *key; #ifdef G_OS_WIN32 - extern gchar *_glib_get_locale_dir (void); gchar *tmp; #endif diff --git a/glib/ggettext.c b/glib/ggettext.c index f8d815e..da8e1a4 100644 --- a/glib/ggettext.c +++ b/glib/ggettext.c @@ -28,6 +28,7 @@ #include "ggettext.h" #include "glibintl.h" +#include "glib-private.h" #include "galloca.h" #include "gthread.h" diff --git a/glib/glib-private.h b/glib/glib-private.h index 23bfb36..f4388ed 100644 --- a/glib/glib-private.h +++ b/glib/glib-private.h @@ -30,6 +30,11 @@ gboolean g_check_setuid (void); G_GNUC_INTERNAL GMainContext * g_main_context_new_with_next_id (guint next_id); +#ifdef G_OS_WIN32 +gchar *_glib_get_dll_directory (void); +gchar *_glib_get_locale_dir (void); +#endif + #define GLIB_PRIVATE_CALL(symbol) (glib__private__()->symbol) typedef struct { diff --git a/glib/gspawn-win32.c b/glib/gspawn-win32.c index 40cb44a..cfb7104 100644 --- a/glib/gspawn-win32.c +++ b/glib/gspawn-win32.c @@ -45,6 +45,7 @@ #include "config.h" #include "glib.h" +#include "glib-private.h" #include "gprintfint.h" #include "glibintl.h" #include "gthread.h" @@ -545,7 +546,6 @@ do_spawn_with_pipes (gint *exit_status, gchar *helper_process; CONSOLE_CURSOR_INFO cursor_info; wchar_t *whelper, **wargv, **wenvp; - extern gchar *_glib_get_dll_directory (void); gchar *glib_dll_directory; if (child_setup && !warned_about_child_setup) -- 2.7.4