[glib/wip/mount-watcher: 1/15] configure: assume alloca exists in alloca.h
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/mount-watcher: 1/15] configure: assume alloca exists in alloca.h
- Date: Wed, 14 Jan 2015 21:53:34 +0000 (UTC)
commit 6dc605cd5411c9292092cbcad4d198a5a638b279
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Jan 7 15:12:12 2015 -0500
configure: assume alloca exists in alloca.h
Assume that a usable alloca() macro is defined in <alloca.h>.
There are not a lot of systems around these days for which that is
untrue.
One exception is Windows (both MSVC and mingw compilers), in which case
alloca() can be found in <malloc.h>.
Note that we no longer define GLIB_HAVE_ALLOCA_H in glibconfig.h
anymore, which could be considered an API change. I don't consider that
to have ever been a public API because it doesn't start with G_, and
even if someone is using it then, by definition, it means that they have
a fallback for the case where it's not defined.
https://bugzilla.gnome.org/show_bug.cgi?id=742548
configure.ac | 9 ---------
glib/galloca.h | 30 +++++-------------------------
2 files changed, 5 insertions(+), 34 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4c2fc45..715497d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2768,9 +2768,6 @@ _______EOF
if test x$glib_values_h = xyes; then
echo '#include <values.h>' >> $outfile
fi
- if test "$glib_header_alloca_h" = "yes"; then
- echo '#define GLIB_HAVE_ALLOCA_H' >> $outfile
- fi
if test x$glib_included_printf != xyes; then
echo "
/* Specifies that GLib's g_print*() functions wrap the
@@ -3084,12 +3081,6 @@ _______EOF
# on variable expansion in case labels. Look at the generated config.status
# for a hint.
-if test "x${ac_cv_working_alloca_h+set}" = xset ; then
- glib_header_alloca_h="$ac_cv_working_alloca_h"
-else
- glib_header_alloca_h="$ac_cv_header_alloca_h"
-fi
-
if test x$enable_included_printf = xyes ; then
glib_included_printf=yes
fi
diff --git a/glib/galloca.h b/glib/galloca.h
index 483a6c8..9d88824 100644
--- a/glib/galloca.h
+++ b/glib/galloca.h
@@ -31,31 +31,11 @@
#include <glib/gtypes.h>
-#if defined(__BIONIC__) && defined (GLIB_HAVE_ALLOCA_H)
-# include <alloca.h>
-#elif defined(__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 */
-# if defined(_MSC_VER) || defined(__DMC__)
-# include <malloc.h>
-# define alloca _alloca
-# else /* !_MSC_VER && !__DMC__ */
-# ifdef _AIX
-# pragma alloca
-# else /* !_AIX */
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-G_BEGIN_DECLS
-char *alloca ();
-G_END_DECLS
-# endif /* !alloca */
-# endif /* !_AIX */
-# endif /* !_MSC_VER && !__DMC__ */
-#endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
+#ifdef G_OS_WIN32
+#include <malloc.h>
+#else
+#include <alloca.h>
+#endif
/**
* g_alloca:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]