Commit 2603dd13 authored by unknown's avatar unknown

- portability fix for AIX in include/my_sys.h: define alloca as a

   compiler builtin when using gcc


include/my_sys.h:
   - Portability fix: define alloca as a compiler builtin on systems
     that have gcc but no alloca.h (e.g. some IBM AIX flavors), use
     "#pragma alloca" when using IBMs compiler (xlr_C)
parent 40d3c390
...@@ -146,6 +146,15 @@ extern my_string my_strdup(const char *from,myf MyFlags); ...@@ -146,6 +146,15 @@ extern my_string my_strdup(const char *from,myf MyFlags);
#define ORIG_CALLER_INFO /* nothing */ #define ORIG_CALLER_INFO /* nothing */
#endif #endif
#ifdef HAVE_ALLOCA #ifdef HAVE_ALLOCA
#ifdef __GNUC__
/* Remove any previous definitions. */
#undef alloca
#define alloca(size) __builtin_alloca (size)
#else /* xlc */
#ifdef _AIX
#pragma alloca
#endif /* _AIX */
#endif /* __GNUC__ */
#define my_alloca(SZ) alloca((size_t) (SZ)) #define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) {} #define my_afree(PTR) {}
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment