]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Deal with alloca.h: libintl doesn't have alloca.h.
authorBruno Haible <bruno@clisp.org>
Thu, 19 Jun 2003 17:34:24 +0000 (17:34 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:43 +0000 (12:10 +0200)
gettext-runtime/intl/printf.c
gettext-runtime/intl/vasnprintf.c
gettext-runtime/libasprintf/ChangeLog
gettext-runtime/libasprintf/vasnprintf.c

index c96ad2f1d01b36d41673235d8f1138b39cfcabdb..5d870743375ffa9c6acd2a4b0142a763c108fa36 100644 (file)
 # include <config.h>
 #endif
 
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  if defined HAVE_ALLOCA_H || defined _LIBC
+#   include <alloca.h>
+#  else
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca
+char *alloca ();
+#    endif
+#   endif
+#  endif
+# endif
+#endif
+
 #include <stdio.h>
 
 #if !HAVE_POSIX_PRINTF
index b8bd3ce85d88f7db4f0cb14e10c95d794e575015..26106e1a856e49a290881269f65440fef456ea11 100644 (file)
@@ -26,7 +26,9 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
-#include <alloca.h>
+#ifndef IN_LIBINTL
+# include <alloca.h>
+#endif
 
 /* Specification.  */
 #if WIDE_CHAR_VERSION
index a3f00c80b2c4b18b364f1a2f478c64a4d7bf6475..657e60222512018c1bd6d01b37cf4b579da3182e 100644 (file)
@@ -6,6 +6,7 @@
        * vasnprintf.c: Generalize to it can be compiled for wide strings.
        (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
        SNPRINTF): New macros.
+       Don't include <alloca.h> if the file is used inside libintl.
 
 2003-05-30  Bruno Haible  <bruno@clisp.org>
 
index b8bd3ce85d88f7db4f0cb14e10c95d794e575015..26106e1a856e49a290881269f65440fef456ea11 100644 (file)
@@ -26,7 +26,9 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
-#include <alloca.h>
+#ifndef IN_LIBINTL
+# include <alloca.h>
+#endif
 
 /* Specification.  */
 #if WIDE_CHAR_VERSION