--- /space/src/trunk/lib/c/public/alloca.h 2009-05-04 14:47:03.000000000 -0400 +++ /opt/qnx/target/qnx6/usr/include/alloca.h 2009-06-12 10:22:05.000000000 -0400 @@ -49,14 +49,27 @@ extern _Sizet __stackavail(void); #pragma aux __doalloca = "sub esp,eax" __parm __nomemory [__eax] __value [__esp] __modify __exact __nomemory [__esp]; #define _alloca(s) __doalloca(__ALLOCA_ALIGN(s)) + #define __ALWAYS_INLINE__ + #define __INLINE__ inline #elif defined(__GNUC__) || defined(__INTEL_COMPILER) extern void *__builtin_alloca(unsigned int __size); #define _alloca(s) __builtin_alloca(s) + #define __ALWAYS_INLINE__ __attribute__((always_inline)) + #define __INLINE__ #else #error not configured for system #endif -#define alloca(s) (((__ALLOCA_ALIGN(s)+128)<__stackavail())?_alloca(s):0) +static __INLINE__ void *alloca(unsigned int) __ALWAYS_INLINE__; + +static __INLINE__ void *alloca(const unsigned int __size) +{ + return (((__ALLOCA_ALIGN(__size)+128)<__stackavail())?_alloca(__size):NULL); +} +#undef __INLINE__ +#undef __ALWAYS_INLINE__ + +//#define alloca(s) ((void*)(((__ALLOCA_ALIGN(s)+128)<__stackavail())?_alloca(s):NULL)) #define __alloca(s) _alloca(s) __END_DECLS