[glib] fix a few warnings on non-Linux
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] fix a few warnings on non-Linux
- Date: Sun, 4 Sep 2011 21:50:57 +0000 (UTC)
commit 749fa587bc081e0f5b9c4af1ed8bdf90bd0856d2
Author: Dan Winship <danw gnome org>
Date: Sun Sep 4 17:17:11 2011 -0400
fix a few warnings on non-Linux
mostly #ifdeffing functions that are only called by #ifdeffed code
gio/gsocketaddress.c | 1 +
gio/xdgmime/xdgmimemagic.c | 2 ++
glib/gfileutils.c | 3 +++
glib/tests/option-argv0.c | 2 ++
4 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gio/gsocketaddress.c b/gio/gsocketaddress.c
index 591a64e..72fdd78 100644
--- a/gio/gsocketaddress.c
+++ b/gio/gsocketaddress.c
@@ -23,6 +23,7 @@
#include <config.h>
#include <glib.h>
+#include <string.h>
#include "gsocketaddress.h"
#include "ginetaddress.h"
diff --git a/gio/xdgmime/xdgmimemagic.c b/gio/xdgmime/xdgmimemagic.c
index 63e0bdd..744eb5a 100644
--- a/gio/xdgmime/xdgmimemagic.c
+++ b/gio/xdgmime/xdgmimemagic.c
@@ -479,7 +479,9 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
/* We clean up the matchlet, byte swapping if needed */
if (matchlet->word_size > 1)
{
+#if LITTLE_ENDIAN
int i;
+#endif
if (matchlet->value_length % matchlet->word_size != 0)
{
_xdg_mime_magic_matchlet_free (matchlet);
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
index 768f8c7..8310531 100644
--- a/glib/gfileutils.c
+++ b/glib/gfileutils.c
@@ -1014,7 +1014,10 @@ write_to_temp_file (const gchar *contents,
}
}
#endif
+
+#ifdef BTRFS_SUPER_MAGIC
no_fsync:
+#endif
errno = 0;
if (fclose (file) == EOF)
diff --git a/glib/tests/option-argv0.c b/glib/tests/option-argv0.c
index 182521e..31fd83b 100644
--- a/glib/tests/option-argv0.c
+++ b/glib/tests/option-argv0.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>
+#ifdef __linux
static void
test_platform_argv0 (void)
{
@@ -45,6 +46,7 @@ test_platform_argv0 (void)
g_assert (strcmp (g_get_prgname(), "option-argv0") == 0
|| strcmp (g_get_prgname (), "lt-option-argv0") == 0);
}
+#endif
int
main (int argc,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]