From 26e2187a7f2ac21aeaa8be6c8f1eaf412360c39f Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Tue, 28 Jul 2026 14:53:48 -0500 Subject: [PATCH] Older toolchains lack alloca so use __builtin_alloca which is more widely available if needed This was affecting the Solaris platform using gcc 4.5.2 Ticket: ENT-14344 Changelog: none --- configure.ac | 1 + libutils/platform.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 1af8ec7e..2e6262fb 100644 --- a/configure.ac +++ b/configure.ac @@ -473,6 +473,7 @@ dnl ###################################################################### AC_C_CONST AC_FUNC_FSEEKO +AC_FUNC_ALLOCA AC_SYS_LARGEFILE AC_TYPE_OFF_T diff --git a/libutils/platform.h b/libutils/platform.h index 80eac96a..ccd3a2bb 100644 --- a/libutils/platform.h +++ b/libutils/platform.h @@ -306,6 +306,24 @@ void globfree(glob_t *pglob); # endif #endif +// from https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/Particular-Functions.html +#if HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +#endif + #include #ifdef HAVE_VFS_H