From f06b1846a2580c3b19a89f5f5e76b7d509afb3c9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 5 Jan 1999 04:02:40 +0000 Subject: Initial revision svn path=/trunk/; revision=2327 --- xalloca.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 xalloca.c diff --git a/xalloca.c b/xalloca.c new file mode 100644 index 00000000..d5ed7abe --- /dev/null +++ b/xalloca.c @@ -0,0 +1,47 @@ +/* + * xalloca.c -- allocate space or die + * + * For license terms, see the file COPYING in this directory. + */ + +#include "config.h" +#include +#include +#include +#if defined(STDC_HEADERS) +#include +#endif +#if defined(HAVE_ALLOCA_H) +#include +#else +#ifdef _AIX + #pragma alloca +#endif +#endif + +#include "fetchmail.h" + +#if defined(HAVE_VOIDPOINTER) +#define XALLOCATYPE void +#else +#define XALLOCATYPE char +#endif + +XALLOCATYPE * +#ifdef __STDC__ +xalloca (size_t n) +#else +xalloca (n) + +int n; +#endif +{ + XALLOCATYPE *p; + + p = (XALLOCATYPE *) alloca(n); + if (p == (XALLOCATYPE *) 0) + error(PS_UNDEFINED, 0, "alloca failed"); + return(p); +} + +/* xalloca.c ends here */ -- cgit v1.2.3