summaryrefslogtreecommitdiff
path: root/m4/ax_c_printf_thsep.m4
blob: d12a3f587a1e02813a8025b180abe494d0bb063e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ===========================================================================
#        http://www.nongnu.org/autoconf-archive/ax_c_printf_thsep.html
# ===========================================================================
#
# OBSOLETE MACRO
#
#   This macro has been deprecated because of technical flaws, i.e. it may
#   generate false positive results. Further details can be found at
#   <http://savannah.nongnu.org/patch/?6848>.
#
# SYNOPSIS
#
#   AX_C_PRINTF_THSEP
#
# DESCRIPTION
#
#   This macro checks whether the compiler supports the ' flag in printf,
#   which causes the non-fractional digits to be separated using a separator
#   and grouping determined by the locale. If true, HAVE_PRINTF_THSEP is
#   defined in config.h
#
# LICENSE
#
#   Copyright (c) 2008 Bill Poser <billposer@alum.mit.edu>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.

AU_ALIAS([AC_C_PRINTF_THSEP], [AX_C_PRINTF_THSEP])
AC_DEFUN([AX_C_PRINTF_THSEP],
[AC_TRY_COMPILE(,[printf("%'2d",101);],ac_cv_c_printf_thsep=yes,ac_cv_c_printf_thsep=no)
 if test $ac_cv_c_printf_thsep = yes; then
  AC_DEFINE(HAVE_PRINTF_THSEP, 1, [compiler understands printf flag for thousands separation in ints])
 fi
])