diff options
Diffstat (limited to 'Xalloca.h')
-rw-r--r-- | Xalloca.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -27,6 +27,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/include/Xalloca.h,v 3.11 2002/12/01 20:08:41 tsi Exp $ */ /* * The purpose of this header is to define the macros ALLOCATE_LOCAL and @@ -82,7 +83,6 @@ from The Open Group. # else /* NCR */ # define ALLOCATE_LOCAL(size) alloca(size) # endif -# define DEALLOCATE_LOCAL(ptr) /* as nothing */ # endif /* defined(__HIGHC__) */ @@ -91,7 +91,6 @@ from The Open Group. # define alloca __builtin_alloca # endif /* !alloca */ # define ALLOCATE_LOCAL(size) alloca((int)(size)) -# define DEALLOCATE_LOCAL(ptr) /* as nothing */ # else /* ! __GNUC__ */ /* @@ -100,22 +99,23 @@ from The Open Group. * from alloca.h which #defines alloca. */ # ifndef NCR -# if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(USL) || defined(alloca) +# if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(alloca) /* * Some System V boxes extract alloca.o from /lib/libPW.a; if you * 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__ # define __Xnullarg /* as nothing */ # ifndef X_NOT_STDC_ENV extern void *alloca(__Xnullarg); # else extern char *alloca(__Xnullarg); # endif +# endif /* __QNX__ */ # endif /* __sgi */ # define ALLOCATE_LOCAL(size) alloca((int)(size)) -# define DEALLOCATE_LOCAL(ptr) /* as nothing */ # endif /* who does alloca */ # endif /* NCR */ # endif /* __GNUC__ */ @@ -130,6 +130,10 @@ from The Open Group. # define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK undefined! # define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK undefined! # endif /* defined(ALLOCATE_LOCAL_FALLBACK && DEALLOCATE_LOCAL_FALLBACK) */ -#endif /* !defined(ALLOCATE_LOCAL) */ +#else +# if !defined(DEALLOCATE_LOCAL) +# define DEALLOCATE_LOCAL(_ptr) do {} while(0) +# endif +#endif /* defined(ALLOCATE_LOCAL) */ #endif /* XALLOCA_H */ |