Changed alloca stuff a bit: when we have a working alloca.h, we're not
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Thu, 5 Oct 2000 09:07:53 +0000 (09:07 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Thu, 5 Oct 2000 09:07:53 +0000 (09:07 +0000)
2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

        * glib.h: Changed alloca stuff a bit: when we have a working
        alloca.h, we're not messing with alloca any further. Should fix a
        bug reported by Bernd Demian <wega@csc-dd.de>.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib.h
glib/glib.h

index d718745..7d32295 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * glib.h: Changed alloca stuff a bit: when we have a working
+       alloca.h, we're not messing with alloca any further. Should fix a
+       bug reported by Bernd Demian <wega@csc-dd.de>.
+
 2000-09-29  Jonathan Blandford  <jrb@redhat.com>
 
        * gnode.c (g_node_insert_after): Added function to keep symetry
index d718745..7d32295 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * glib.h: Changed alloca stuff a bit: when we have a working
+       alloca.h, we're not messing with alloca any further. Should fix a
+       bug reported by Bernd Demian <wega@csc-dd.de>.
+
 2000-09-29  Jonathan Blandford  <jrb@redhat.com>
 
        * gnode.c (g_node_insert_after): Added function to keep symetry
index d718745..7d32295 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * glib.h: Changed alloca stuff a bit: when we have a working
+       alloca.h, we're not messing with alloca any further. Should fix a
+       bug reported by Bernd Demian <wega@csc-dd.de>.
+
 2000-09-29  Jonathan Blandford  <jrb@redhat.com>
 
        * gnode.c (g_node_insert_after): Added function to keep symetry
index d718745..7d32295 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * glib.h: Changed alloca stuff a bit: when we have a working
+       alloca.h, we're not messing with alloca any further. Should fix a
+       bug reported by Bernd Demian <wega@csc-dd.de>.
+
 2000-09-29  Jonathan Blandford  <jrb@redhat.com>
 
        * gnode.c (g_node_insert_after): Added function to keep symetry
index d718745..7d32295 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * glib.h: Changed alloca stuff a bit: when we have a working
+       alloca.h, we're not messing with alloca any further. Should fix a
+       bug reported by Bernd Demian <wega@csc-dd.de>.
+
 2000-09-29  Jonathan Blandford  <jrb@redhat.com>
 
        * gnode.c (g_node_insert_after): Added function to keep symetry
index d718745..7d32295 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * glib.h: Changed alloca stuff a bit: when we have a working
+       alloca.h, we're not messing with alloca any further. Should fix a
+       bug reported by Bernd Demian <wega@csc-dd.de>.
+
 2000-09-29  Jonathan Blandford  <jrb@redhat.com>
 
        * gnode.c (g_node_insert_after): Added function to keep symetry
index d718745..7d32295 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * glib.h: Changed alloca stuff a bit: when we have a working
+       alloca.h, we're not messing with alloca any further. Should fix a
+       bug reported by Bernd Demian <wega@csc-dd.de>.
+
 2000-09-29  Jonathan Blandford  <jrb@redhat.com>
 
        * gnode.c (g_node_insert_after): Added function to keep symetry
index d718745..7d32295 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * glib.h: Changed alloca stuff a bit: when we have a working
+       alloca.h, we're not messing with alloca any further. Should fix a
+       bug reported by Bernd Demian <wega@csc-dd.de>.
+
 2000-09-29  Jonathan Blandford  <jrb@redhat.com>
 
        * gnode.c (g_node_insert_after): Added function to keep symetry
diff --git a/glib.h b/glib.h
index 7ba589b..a59779c 100644 (file)
--- a/glib.h
+++ b/glib.h
@@ -333,30 +333,27 @@ extern "C" {
 #endif /* __i386__ */
 
 /* g_alloca handling */
-#ifdef GLIB_HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include <string.h>
-#ifdef __GNUC__
-/* glibc already does this for us */
-#ifndef alloca
-# define alloca(size) __builtin_alloca (size)
-#endif
-#else
+#ifdef  __GNUC__
+/* GCC does the right thing */
+# undef alloca
+# define alloca(size)   __builtin_alloca (size)
+#elif defined (GLIB_HAVE_ALLOCA_H)
+/* a native and working alloca.h is there */ 
+# include <alloca.h>
+#else /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
 # ifdef _MSC_VER
 #  include <malloc.h>
 #  define alloca _alloca
-# else
-#   ifdef _AIX
+# else /* !_MSC_VER */
+#  ifdef _AIX
  #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
+#  else /* !_AIX */
+#   ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
-#    endif
-#   endif
-# endif
-#endif
+#   endif /* !alloca */
+#  endif /* !_AIX */
+# endif /* !_MSC_VER */
+#endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
 
 #define g_alloca(size) alloca (size)
 /* End g_alloca handling */
index 7ba589b..a59779c 100644 (file)
@@ -333,30 +333,27 @@ extern "C" {
 #endif /* __i386__ */
 
 /* g_alloca handling */
-#ifdef GLIB_HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include <string.h>
-#ifdef __GNUC__
-/* glibc already does this for us */
-#ifndef alloca
-# define alloca(size) __builtin_alloca (size)
-#endif
-#else
+#ifdef  __GNUC__
+/* GCC does the right thing */
+# undef alloca
+# define alloca(size)   __builtin_alloca (size)
+#elif defined (GLIB_HAVE_ALLOCA_H)
+/* a native and working alloca.h is there */ 
+# include <alloca.h>
+#else /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
 # ifdef _MSC_VER
 #  include <malloc.h>
 #  define alloca _alloca
-# else
-#   ifdef _AIX
+# else /* !_MSC_VER */
+#  ifdef _AIX
  #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
+#  else /* !_AIX */
+#   ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
-#    endif
-#   endif
-# endif
-#endif
+#   endif /* !alloca */
+#  endif /* !_AIX */
+# endif /* !_MSC_VER */
+#endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
 
 #define g_alloca(size) alloca (size)
 /* End g_alloca handling */