VirtualBox

source: kBuild/trunk/src/grep/m4/snprintf.m4

Last change on this file was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:eol-style set to LF
File size: 1.9 KB
Line 
1# snprintf.m4 serial 7
2dnl Copyright (C) 2002-2004, 2007-2021 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Libintl 0.17 will replace snprintf only if it does not support %1$s,
8dnl but defers to any gnulib snprintf replacements. Therefore, gnulib
9dnl must guarantee that the decision for replacing snprintf is a superset
10dnl of the reasons checked by libintl.
11AC_DEFUN([gl_FUNC_SNPRINTF],
12[
13 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
14 gl_cv_func_snprintf_usable=no
15 AC_CHECK_FUNCS([snprintf])
16 if test $ac_cv_func_snprintf = yes; then
17 gl_SNPRINTF_SIZE1
18 case "$gl_cv_func_snprintf_size1" in
19 *yes)
20 gl_SNPRINTF_RETVAL_C99
21 case "$gl_cv_func_snprintf_retval_c99" in
22 *yes)
23 gl_PRINTF_POSITIONS
24 case "$gl_cv_func_printf_positions" in
25 *yes)
26 gl_cv_func_snprintf_usable=yes
27 ;;
28 esac
29 ;;
30 esac
31 ;;
32 esac
33 fi
34 if test $gl_cv_func_snprintf_usable = no; then
35 gl_REPLACE_SNPRINTF
36 fi
37 AC_CHECK_DECLS_ONCE([snprintf])
38 if test $ac_cv_have_decl_snprintf = no; then
39 HAVE_DECL_SNPRINTF=0
40 fi
41])
42
43AC_DEFUN([gl_REPLACE_SNPRINTF],
44[
45 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
46 AC_LIBOBJ([snprintf])
47 if test $ac_cv_func_snprintf = yes; then
48 REPLACE_SNPRINTF=1
49 else
50 AC_CHECK_DECLS_ONCE([snprintf])
51 if test $ac_cv_have_decl_snprintf = yes; then
52 dnl If the function is declared but does not appear to exist, it may be
53 dnl defined as an inline function. In order to avoid a conflict, we have
54 dnl to define rpl_snprintf, not snprintf.
55 REPLACE_SNPRINTF=1
56 fi
57 fi
58 gl_PREREQ_SNPRINTF
59])
60
61# Prerequisites of lib/snprintf.c.
62AC_DEFUN([gl_PREREQ_SNPRINTF], [:])
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette