summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <lenz@mysql.com>2002-08-08 20:09:57 +0200
committerunknown <lenz@mysql.com>2002-08-08 20:09:57 +0200
commit2603dd13363e2d28f302dfd6cad05238b2d979f8 (patch)
treedd78931826333b3f9b07ecf47740048a58aae2d3 /include
parent40d3c3901b0427eba76119730f46784f946990b3 (diff)
downloadmariadb-git-2603dd13363e2d28f302dfd6cad05238b2d979f8.tar.gz
- 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)
Diffstat (limited to 'include')
-rw-r--r--include/my_sys.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index 8cdc78025f3..61395114a5d 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -146,6 +146,15 @@ extern my_string my_strdup(const char *from,myf MyFlags);
#define ORIG_CALLER_INFO /* nothing */
#endif
#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_afree(PTR) {}
#else