# HG changeset patch # User martinb # Date 992234692 0 # Node ID 4f50f8a33f96f3780b8aca3b3e2183b6c785c005 # Parent 42bfaea7639538c3f33b70d26357f1f21127bd95 [xemacs-hg @ 2001-06-11 04:44:52 by martinb] alloca vs. _XOPEN_SOURCE diff -r 42bfaea76395 -r 4f50f8a33f96 src/ChangeLog --- a/src/ChangeLog Mon Jun 11 01:55:28 2001 +0000 +++ b/src/ChangeLog Mon Jun 11 04:44:52 2001 +0000 @@ -1,3 +1,10 @@ +2001-06-12 Martin Buchholz + + * config.h.in (alloca): All feature test macros must be defined + before the first system header file inclusion. So move alloca + twiddling after the feature test definitions, but before the first + "real" code. + 2001-06-11 Martin Buchholz * lisp.h (DECIMAL_PRINT_SIZE): Don't use floating point. diff -r 42bfaea76395 -r 4f50f8a33f96 src/config.h.in --- a/src/config.h.in Mon Jun 11 01:55:28 2001 +0000 +++ b/src/config.h.in Mon Jun 11 04:44:52 2001 +0000 @@ -26,26 +26,6 @@ #ifndef _SRC_CONFIG_H_ #define _SRC_CONFIG_H_ - -/* alloca twiddling belongs in one place, not the s&m headers - AIX requires this to be the first thing in the file. */ -#undef HAVE_ALLOCA_H - -#ifndef NOT_C_CODE -#ifdef __GNUC__ -#define alloca __builtin_alloca -#elif defined __DECC -#include -#pragma intrinsic(alloca) -#elif defined HAVE_ALLOCA_H -#include -#elif defined(_AIX) -#pragma alloca -#elif ! defined (alloca) -void *alloca (); -#endif -#endif /* C code */ - /* Use this to add code in a structured way to FSF-maintained source files so as to make it obvious where XEmacs changes are. */ #define XEMACS 1 @@ -603,6 +583,26 @@ definitions isn't right with 64-bit systems. */ #undef USE_UNION_TYPE +/* alloca twiddling. + Because we might be #including alloca.h here, feature test macros + such as _XOPEN_SOURCE must be defined above. */ +#undef HAVE_ALLOCA_H +#ifndef NOT_C_CODE +#ifdef __GNUC__ +#define alloca __builtin_alloca +#elif defined __DECC +#include +#pragma intrinsic(alloca) +#elif defined HAVE_ALLOCA_H +#include +#elif defined(_AIX) +/* AIX requires this before any "real" code in the translation unit. */ +#pragma alloca +#elif ! defined (alloca) +void *alloca (); +#endif +#endif /* C code */ + /* The configuration script may define `opsysfile' to be the name of the s/...h file that describes your operating system. The file name is chosen based on the configuration name. */