Re: (patch) strdupa for GLib - 2nd try
- From: Jeff Garzik <jgarzik pobox com>
- To: Manish Singh <yosh gimp org>
- cc: gtk-devel-list redhat com
- Subject: Re: (patch) strdupa for GLib - 2nd try
- Date: Wed, 30 Dec 1998 14:06:46 -0500 (EST)
On Wed, 30 Dec 1998, Manish Singh wrote:
> alloca() declaration stuff is a bit of a mess really, which is why autoconf
> provides AC_FUNC_ALLOCA. The info documentation is quite lucid on the
> topic, so I suggest reading up on that (it even has provisions for using
> an alloca.c if it's not found at all on the system.
heh I was just updating the autoconf docs a couple days ago, saw this
then, and then promptly forgot about it. ;-)
> Now regarding headers, I think we should strive to keep glib.h from
> polluting the namespace much more than it does now, since #including
> some headers can produce breakage (which is why we pull the defs from
> pthread.h and sys/poll.h instead of #including them directly). Now I
> dunno how to do this with with alloca, or even if we can, any ideas? :)
The following code comes from the autoconf docs. Maybe
s/HAVE_ALLOCA_H/G_HAVE_ALLOCA_H/, and include this in glibconfig.h?
>From reading Linux and solaris alloca.h it seems helpful to include it,
if gcc is not being used (an unlikely case on Linux :)).
Jeff
/* AIX requires this to be the first thing in the file. */
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
# endif
# endif
# endif
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]