bug-gnulib
[Top][All Lists]
Advanced

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

Re: alloca in HP NonStop


From: Paul Eggert
Subject: Re: alloca in HP NonStop
Date: Tue, 03 Jul 2012 01:44:47 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 07/02/2012 11:40 PM, Joachim Schmitz wrote:
> I' don't quite understand, why not the entire alloca.in.h is bracketed by 
> this.
> At least now that it is used in 2 places?

We can't bracket the entire file, since (as far as I know)
it's not safe to put #include inside 'extern "C" { ... }'.
How about the following patch instead?
It tries to address your other comments.

diff --git a/ChangeLog b/ChangeLog
index e7f7883..9dda6c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-03  Paul Eggert  <address@hidden>
+
+       alloca: add support for HP NonStop TNS/E native
+       * lib/alloca.in.h (alloca): Support the new host.
+       From a suggestion by Joachim Schmitz in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00355.html>.
+
 2012-07-02  Pádraig Brady  <address@hidden>
 
        fsusage: remove code not needed on non GNU/Linux systems.
diff --git a/lib/alloca.in.h b/lib/alloca.in.h
index 99be048..ed8aad3 100644
--- a/lib/alloca.in.h
+++ b/lib/alloca.in.h
@@ -45,11 +45,18 @@
 # elif defined __DECC && defined __VMS
 #  define alloca __ALLOCA
 # else
-#  include <stddef.h>
+#  if defined __TANDEM && defined _TNS_E_TARGET
+#   pragma intrinsic (_alloca)
+#   define alloca _alloca
+typedef unsigned short _GL_ALLOCA_SIZE_T;
+#  else
+#   include <stddef.h>
+typedef size_t _GL_ALLOCA_SIZE_T;
+#  endif
 #  ifdef  __cplusplus
 extern "C"
 #  endif
-void *alloca (size_t);
+void *alloca (_GL_ALLOCA_SIZE_T);
 # endif
 #endif
 



reply via email to

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