Mercurial > hg > octave-kai > gnulib-hg
annotate m4/snprintf-posix.m4 @ 8803:6c1d98929550
Work around lack of support of grouping flag.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 06 May 2007 15:29:04 +0000 |
parents | 39bb5430fc0e |
children | 6ce313658b4d |
rev | line source |
---|---|
8803
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
1 # snprintf-posix.m4 serial 5 |
8366 | 2 dnl Copyright (C) 2007 Free Software Foundation, Inc. |
3 dnl This file is free software; the Free Software Foundation | |
4 dnl gives unlimited permission to copy and/or distribute it, | |
5 dnl with or without modifications, as long as this notice is preserved. | |
6 | |
7 AC_DEFUN([gl_FUNC_SNPRINTF_POSIX], | |
8 [ | |
9 AC_REQUIRE([gl_EOVERFLOW]) | |
10 AC_REQUIRE([gl_PRINTF_SIZES_C99]) | |
11 AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) | |
8664
40c507f55b0f
Implement the %F directive if the system doesn't implement it correctly.
Bruno Haible <bruno@clisp.org>
parents:
8554
diff
changeset
|
12 AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) |
8366 | 13 AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) |
14 AC_REQUIRE([gl_PRINTF_POSITIONS]) | |
8803
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
15 AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) |
8366 | 16 gl_cv_func_snprintf_posix=no |
17 AC_CHECK_FUNCS([snprintf]) | |
18 if test $ac_cv_func_snprintf = yes; then | |
19 gl_SNPRINTF_TRUNCATION_C99 | |
20 gl_SNPRINTF_RETVAL_C99 | |
21 gl_SNPRINTF_DIRECTIVE_N | |
8763
39bb5430fc0e
Guard against vsnprintf implementations that mishandle a size=0 argument.
Bruno Haible <bruno@clisp.org>
parents:
8664
diff
changeset
|
22 gl_VSNPRINTF_ZEROSIZE_C99 |
8389
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
23 case "$gl_cv_func_printf_sizes_c99" in |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
24 *yes) |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
25 case "$gl_cv_func_printf_directive_a" in |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
26 *yes) |
8664
40c507f55b0f
Implement the %F directive if the system doesn't implement it correctly.
Bruno Haible <bruno@clisp.org>
parents:
8554
diff
changeset
|
27 case "$gl_cv_func_printf_directive_f" in |
8389
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
28 *yes) |
8664
40c507f55b0f
Implement the %F directive if the system doesn't implement it correctly.
Bruno Haible <bruno@clisp.org>
parents:
8554
diff
changeset
|
29 case "$gl_cv_func_printf_directive_n" in |
8389
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
30 *yes) |
8664
40c507f55b0f
Implement the %F directive if the system doesn't implement it correctly.
Bruno Haible <bruno@clisp.org>
parents:
8554
diff
changeset
|
31 case "$gl_cv_func_printf_positions" in |
8389
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
32 *yes) |
8803
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
33 case "$gl_cv_func_printf_flag_grouping" in |
8389
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
34 *yes) |
8803
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
35 case "$gl_cv_func_snprintf_truncation_c99" in |
8389
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
36 *yes) |
8803
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
37 case "$gl_cv_func_snprintf_retval_c99" in |
8664
40c507f55b0f
Implement the %F directive if the system doesn't implement it correctly.
Bruno Haible <bruno@clisp.org>
parents:
8554
diff
changeset
|
38 *yes) |
8803
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
39 case "$gl_cv_func_snprintf_directive_n" in |
8763
39bb5430fc0e
Guard against vsnprintf implementations that mishandle a size=0 argument.
Bruno Haible <bruno@clisp.org>
parents:
8664
diff
changeset
|
40 *yes) |
8803
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
41 case "$gl_cv_func_vsnprintf_zerosize_c99" in |
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
42 *yes) |
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
43 # snprintf exists and is already |
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
44 # POSIX compliant. |
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
45 gl_cv_func_snprintf_posix=yes |
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
46 ;; |
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
47 esac |
8763
39bb5430fc0e
Guard against vsnprintf implementations that mishandle a size=0 argument.
Bruno Haible <bruno@clisp.org>
parents:
8664
diff
changeset
|
48 ;; |
39bb5430fc0e
Guard against vsnprintf implementations that mishandle a size=0 argument.
Bruno Haible <bruno@clisp.org>
parents:
8664
diff
changeset
|
49 esac |
8664
40c507f55b0f
Implement the %F directive if the system doesn't implement it correctly.
Bruno Haible <bruno@clisp.org>
parents:
8554
diff
changeset
|
50 ;; |
40c507f55b0f
Implement the %F directive if the system doesn't implement it correctly.
Bruno Haible <bruno@clisp.org>
parents:
8554
diff
changeset
|
51 esac |
8389
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
52 ;; |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
53 esac |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
54 ;; |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
55 esac |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
56 ;; |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
57 esac |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
58 ;; |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
59 esac |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
60 ;; |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
61 esac |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
62 ;; |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
63 esac |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
64 ;; |
e7c9cf0455da
Use 'case' statements instead of 'expr' invocations.
Bruno Haible <bruno@clisp.org>
parents:
8366
diff
changeset
|
65 esac |
8366 | 66 fi |
67 if test $gl_cv_func_snprintf_posix = no; then | |
8554
35eb5062216c
Prefer nl_langinfo over localeconv.
Bruno Haible <bruno@clisp.org>
parents:
8389
diff
changeset
|
68 gl_PREREQ_VASNPRINTF_DIRECTIVE_A |
8664
40c507f55b0f
Implement the %F directive if the system doesn't implement it correctly.
Bruno Haible <bruno@clisp.org>
parents:
8554
diff
changeset
|
69 gl_PREREQ_VASNPRINTF_DIRECTIVE_F |
8803
6c1d98929550
Work around lack of support of grouping flag.
Bruno Haible <bruno@clisp.org>
parents:
8763
diff
changeset
|
70 gl_PREREQ_VASNPRINTF_FLAG_GROUPING |
8366 | 71 gl_REPLACE_VASNPRINTF |
72 gl_REPLACE_SNPRINTF | |
73 fi | |
74 ]) |