summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>2000-03-21 15:21:41 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>2000-03-21 15:21:41 +0000
commit66034865b17cde557bfba6d456eaaf2641c35bb5 (patch)
tree9e0d70e4e8058b1a88cb49bd578cf7530fbc5b43 /glib
parentcdb61955724cd0f97546a86421b52b4da66e8ae5 (diff)
downloadglib-66034865b17cde557bfba6d456eaaf2641c35bb5.tar.gz
always define G_GNUC_EXTENSION, even when not needed by GLib. That's
2000-03-21 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION, even when not needed by GLib. That's actually also the way, the GLib reference manual describes that macro. Therefore I had to remove the lonesome #include <glibconfig.h> in gutils.c, which doesn't seem to be needed there however. This change should make Ben Gertzfield <che@debian.org> happy. * gutils.c: Furthermore two warnings in gutils.c were voided, which crept in due to my last change.
Diffstat (limited to 'glib')
-rw-r--r--glib/glib.h15
-rw-r--r--glib/gutils.c6
2 files changed, 15 insertions, 6 deletions
diff --git a/glib/glib.h b/glib/glib.h
index e4e6a6397..b2a289a4a 100644
--- a/glib/glib.h
+++ b/glib/glib.h
@@ -1,4 +1,3 @@
-
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
@@ -28,6 +27,19 @@
#ifndef __G_LIB_H__
#define __G_LIB_H__
+/* Here we provide G_GNUC_EXTENSION as an alias for __extension__,
+ * where this is valid. This allows for warningless compilation of
+ * "long long" types even in the presence of '-ansi -pedantic'. This
+ * of course should be with the other GCC-isms below, but then
+ * glibconfig.h wouldn't load cleanly and it is better to have that
+ * here, than in glibconfig.h.
+ */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+# define G_GNUC_EXTENSION __extension__
+#else
+# define G_GNUC_EXTENSION
+#endif
+
/* system specific config file glibconfig.h provides definitions for
* the extrema of many of the standard types. These are:
*
@@ -266,7 +278,6 @@ extern "C" {
#define G_GNUC_UNUSED
#endif /* !__GNUC__ */
-
/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
* macros, so we can refer to them as strings unconditionally.
*/
diff --git a/glib/gutils.c b/glib/gutils.c
index a6784fea2..a44c4fa8b 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -32,8 +32,6 @@
#include <config.h>
#endif
-#include "glibconfig.h"
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -334,8 +332,8 @@ g_dirname (const gchar *file_name)
gchar*
g_get_current_dir (void)
{
- gchar *buffer;
- gchar *dir;
+ gchar *buffer = NULL;
+ gchar *dir = NULL;
static gulong max_len = (G_PATH_LENGTH == -1) ? 2048 : G_PATH_LENGTH;
/* We don't use getcwd(3) on SUNOS, because, it does a popen("pwd")