aboutsummaryrefslogtreecommitdiff
path: root/m4/printf-posix.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/printf-posix.m4')
-rw-r--r--m4/printf-posix.m434
1 files changed, 18 insertions, 16 deletions
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4
index 186ba6a6..3be95c13 100644
--- a/m4/printf-posix.m4
+++ b/m4/printf-posix.m4
@@ -1,10 +1,8 @@
1# printf-posix.m4 serial 2 (gettext-0.13.1) 1# printf-posix.m4 serial 6 (gettext-0.18.2)
2dnl Copyright (C) 2003 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2007, 2009-2014 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU 3dnl This file is free software; the Free Software Foundation
4dnl General Public License. As a special exception to the GNU General 4dnl gives unlimited permission to copy and/or distribute it,
5dnl Public License, this file may be distributed as part of a program 5dnl with or without modifications, as long as this notice is preserved.
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8 6
9dnl From Bruno Haible. 7dnl From Bruno Haible.
10dnl Test whether the printf() function supports POSIX/XSI format strings with 8dnl Test whether the printf() function supports POSIX/XSI format strings with
@@ -16,7 +14,8 @@ AC_DEFUN([gt_PRINTF_POSIX],
16 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], 14 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
17 gt_cv_func_printf_posix, 15 gt_cv_func_printf_posix,
18 [ 16 [
19 AC_TRY_RUN([ 17 AC_RUN_IFELSE(
18 [AC_LANG_SOURCE([[
20#include <stdio.h> 19#include <stdio.h>
21#include <string.h> 20#include <string.h>
22/* The string "%2$d %1$d", with dollar characters protected from the shell's 21/* The string "%2$d %1$d", with dollar characters protected from the shell's
@@ -27,19 +26,22 @@ int main ()
27{ 26{
28 sprintf (buf, format, 33, 55); 27 sprintf (buf, format, 33, 55);
29 return (strcmp (buf, "55 33") != 0); 28 return (strcmp (buf, "55 33") != 0);
30}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, 29}]])],
31 [ 30 [gt_cv_func_printf_posix=yes],
32 AC_EGREP_CPP(notposix, [ 31 [gt_cv_func_printf_posix=no],
33#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ 32 [
33 AC_EGREP_CPP([notposix], [
34#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
34 notposix 35 notposix
35#endif 36#endif
36 ], gt_cv_func_printf_posix="guessing no", 37 ],
37 gt_cv_func_printf_posix="guessing yes") 38 [gt_cv_func_printf_posix="guessing no"],
38 ]) 39 [gt_cv_func_printf_posix="guessing yes"])
40 ])
39 ]) 41 ])
40 case $gt_cv_func_printf_posix in 42 case $gt_cv_func_printf_posix in
41 *yes) 43 *yes)
42 AC_DEFINE(HAVE_POSIX_PRINTF, 1, 44 AC_DEFINE([HAVE_POSIX_PRINTF], [1],
43 [Define if your printf() function supports format strings with positions.]) 45 [Define if your printf() function supports format strings with positions.])
44 ;; 46 ;;
45 esac 47 esac