1
1
mc/src/poptalloca.h
Norbert Warmuth fb16422da4 1999-08-03 Norbert Warmuth <nwarmuth@privat.circular.de>
* src/poptalloca.h: New file with definitions for alloca. Note: alloca
is defined as malloc on systems which fail to support alloca. Don't
include this file if you frequently use alloca.

* src/findme.c, src/popt*.c: include poptalloca.h

* src/Makefile.in: added poptalloca.h

* src/menu.c (create_menu): set minimum menu width to 20 characters as
it used to be (this was part of davids patches but I haven't
applied it, yet).
1999-08-03 05:17:47 +00:00

47 строки
1.3 KiB
C

/* Definitions for alloca (mostly extracted from AC_FUNC_ALLOCA). According
to the autoconf manual in dome versions of AIX the declaration of alloca
has to precede everything else execept comments and prepocessor directives,
i.e. including this file has to preceed anything else.
NOTE: alloca is redefined as malloc on systems which fail to support alloca.
Don't include this header if you frequently use alloca in order to avoid an
unlimited amount of memory leaks.
popt uses alloca only during program startup, i.e. the memory leaks caused
by this redefinition are limited.
*/
#ifndef POPTALLOCA_H
#define POPTALLOCA_H
/* AIX requires this to be the first thing in the file. */
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
# include <malloc.h>
# define alloca _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
#endif
#ifndef HAVE_ALLOCA
# include <stdlib.h>
# ifdef HAVE_MALLOC_H
# include <malloc.h>
# endif
# define alloca malloc
#endif
#endif