bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

alloca in HP NonStop


From: Joachim Schmitz
Subject: alloca in HP NonStop
Date: Thu, 28 Jun 2012 18:41:32 +0200

Hi folks

Here's how one could go about to take advantage of the builtin _alloca on HP 
NonStop in GNUlib:

/usr/local/bin/diff -EBbu ./alloca.in.h.orig ./alloca.in.h
--- ./alloca.in.h.orig  2011-03-12 03:14:26.000000000 -0600
+++ ./alloca.in.h       2012-06-28 02:20:06.000000000 -0500
@@ -46,6 +46,20 @@
 #  define alloca _alloca
 # elif defined __DECC && defined __VMS
 #  define alloca __ALLOCA
+# elif defined __TANDEM /* HP NonStop */
+#  ifdef _TNS_E_TARGET) /* TNS/E, Itanium */
+#   if (__H_Series_RVU >= 622) /* as of O/S release H06.22 resp. J06.11 */
+#    include <builtin.h> /* for _alloca() and the pragma */
+#   else /* the gist of builtin.h for systems lacking it */
+#    define  _BUILTIN
+#    ifdef  __cplusplus
+      extern "C"
+#    endif
+     void *_alloca(unsigned short); /* note the different prototype */
+#    pragma intrinsic(_alloca) /* enable compiler builtin _alloca */
+#   endif
+#   define alloca _alloca /* map _alloca to alloca */
+#  endif /* on other/older HP NonStop targets (TNS, RISC and TNS/R, MIPS) use 
GNUlib's alloca() */
 # else
 #  include <stddef.h>
#  ifdef  __cplusplus

Instead of the check for being on the right release (__H_Series_RVU >= 622), we 
could also check for HAVE_BUILTIN_H or some such. Or drop it an just take the 
else branch.
What is missing, and I have no idea where/how this needs to get added, is the 
corresponding checks for configure.

Bye, Jojo






reply via email to

[Prev in Thread] Current Thread [Next in Thread]