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.m426
1 files changed, 15 insertions, 11 deletions
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4
index af10170af..3be95c130 100644
--- a/m4/printf-posix.m4
+++ b/m4/printf-posix.m4
@@ -1,5 +1,5 @@
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; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -14,7 +14,8 @@ AC_DEFUN([gt_PRINTF_POSIX],
14 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], 14 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
15 gt_cv_func_printf_posix, 15 gt_cv_func_printf_posix,
16 [ 16 [
17 AC_TRY_RUN([ 17 AC_RUN_IFELSE(
18 [AC_LANG_SOURCE([[
18#include <stdio.h> 19#include <stdio.h>
19#include <string.h> 20#include <string.h>
20/* 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
@@ -25,19 +26,22 @@ int main ()
25{ 26{
26 sprintf (buf, format, 33, 55); 27 sprintf (buf, format, 33, 55);
27 return (strcmp (buf, "55 33") != 0); 28 return (strcmp (buf, "55 33") != 0);
28}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, 29}]])],
29 [ 30 [gt_cv_func_printf_posix=yes],
30 AC_EGREP_CPP(notposix, [ 31 [gt_cv_func_printf_posix=no],
31#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__
32 notposix 35 notposix
33#endif 36#endif
34 ], gt_cv_func_printf_posix="guessing no", 37 ],
35 gt_cv_func_printf_posix="guessing yes") 38 [gt_cv_func_printf_posix="guessing no"],
36 ]) 39 [gt_cv_func_printf_posix="guessing yes"])
40 ])
37 ]) 41 ])
38 case $gt_cv_func_printf_posix in 42 case $gt_cv_func_printf_posix in
39 *yes) 43 *yes)
40 AC_DEFINE(HAVE_POSIX_PRINTF, 1, 44 AC_DEFINE([HAVE_POSIX_PRINTF], [1],
41 [Define if your printf() function supports format strings with positions.]) 45 [Define if your printf() function supports format strings with positions.])
42 ;; 46 ;;
43 esac 47 esac