From 5ae4d304ecb5fb4af0435c9f2efde3d2da5905d1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 30 Oct 2007 18:44:49 -0700 Subject: [PATCH] Make Xalloca.h work with Sun C++ compiler --- Xalloca.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Xalloca.h b/Xalloca.h index 67f2671..c561718 100644 --- a/Xalloca.h +++ b/Xalloca.h @@ -62,7 +62,8 @@ from The Open Group. #define XALLOCA_H 1 #ifndef INCLUDE_ALLOCA_H -# if defined(__SUNPRO_C) /* Need to add more here to match Imake *.cf's */ +/* Need to add more here to match Imake *.cf's */ +# if defined(HAVE_ALLOCA_H) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) # define INCLUDE_ALLOCA_H # endif #endif @@ -111,16 +112,14 @@ from The Open Group. * decide that you don't want to use alloca, you might want to fix it here. */ /* alloca might be a macro taking one arg (hi, Sun!), so give it one. */ -# ifndef __sgi /* IRIX 5/6 has definition */ -# ifndef __QNX__ +# if !defined(__sgi) && !defined(__QNX__) && !defined(__cplusplus) # define __Xnullarg /* as nothing */ # ifndef X_NOT_STDC_ENV extern void *alloca(__Xnullarg); # else extern char *alloca(__Xnullarg); # endif -# endif /* __QNX__ */ -# endif /* __sgi */ +# endif /* !__sgi && !__QNX && !__cplusplus */ # define ALLOCATE_LOCAL(size) alloca((int)(size)) # endif /* who does alloca */ # endif /* NCR */