diff options
author | Sebastian Wilhelmi <wilhelmi@ira.uka.de> | 2000-10-05 09:07:53 +0000 |
---|---|---|
committer | Sebastian Wilhelmi <wilhelmi@src.gnome.org> | 2000-10-05 09:07:53 +0000 |
commit | e2085327a231c5eed96f3dd2e3ec93f1bef27a0e (patch) | |
tree | fe2b076b03867f18b9b47c9055592acbe66acbba /glib.h | |
parent | 81c0bf53a8cb900f5e3b34ab663ed6781349a65f (diff) | |
download | glib-e2085327a231c5eed96f3dd2e3ec93f1bef27a0e.tar.gz |
Changed alloca stuff a bit: when we have a working alloca.h, we're not
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>.
Diffstat (limited to 'glib.h')
-rw-r--r-- | glib.h | 35 |
1 files changed, 16 insertions, 19 deletions
@@ -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 */ |