diff options
Diffstat (limited to 'gl/m4/vasnprintf.m4')
-rw-r--r-- | gl/m4/vasnprintf.m4 | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4 index 50a20cc..ebe3c52 100644 --- a/gl/m4/vasnprintf.m4 +++ b/gl/m4/vasnprintf.m4 | |||
@@ -1,4 +1,4 @@ | |||
1 | # vasnprintf.m4 serial 29 | 1 | # vasnprintf.m4 serial 31 |
2 | dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
@@ -54,6 +54,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE], | |||
54 | # Prerequisites of lib/vasnprintf.c. | 54 | # Prerequisites of lib/vasnprintf.c. |
55 | AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], | 55 | AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], |
56 | [ | 56 | [ |
57 | AC_REQUIRE([AC_C_INLINE]) | ||
57 | AC_REQUIRE([AC_FUNC_ALLOCA]) | 58 | AC_REQUIRE([AC_FUNC_ALLOCA]) |
58 | AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) | 59 | AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) |
59 | AC_REQUIRE([gt_TYPE_WCHAR_T]) | 60 | AC_REQUIRE([gt_TYPE_WCHAR_T]) |
@@ -62,6 +63,17 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], | |||
62 | dnl Use the _snprintf function only if it is declared (because on NetBSD it | 63 | dnl Use the _snprintf function only if it is declared (because on NetBSD it |
63 | dnl is defined as a weak alias of snprintf; we prefer to use the latter). | 64 | dnl is defined as a weak alias of snprintf; we prefer to use the latter). |
64 | AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>]) | 65 | AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>]) |
66 | dnl We can avoid a lot of code by assuming that snprintf's return value | ||
67 | dnl conforms to ISO C99. So check that. | ||
68 | AC_REQUIRE([gl_SNPRINTF_RETVAL_C99]) | ||
69 | case "$gl_cv_func_snprintf_retval_c99" in | ||
70 | *yes) | ||
71 | AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1], | ||
72 | [Define if the return value of the snprintf function is the number of | ||
73 | of bytes (excluding the terminating NUL) that would have been produced | ||
74 | if the buffer had been large enough.]) | ||
75 | ;; | ||
76 | esac | ||
65 | ]) | 77 | ]) |
66 | 78 | ||
67 | # Extra prerequisites of lib/vasnprintf.c for supporting 'long double' | 79 | # Extra prerequisites of lib/vasnprintf.c for supporting 'long double' |