"Fossies" - the Fresh Open Source Software Archive

Member "ruby-2.7.4/tool/m4/ruby_check_printf_prefix.m4" (7 Jul 2021, 1375 Bytes) of package /linux/misc/ruby-2.7.4.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "ruby_check_printf_prefix.m4": 2.7.3_vs_2.7.4.

    1 # -*- Autoconf -*-
    2 AC_DEFUN([RUBY_CHECK_PRINTF_PREFIX], [
    3 AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
    4     [rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE]
    5     RUBY_WERROR_FLAG(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags)
    6     for pri in $2; do
    7         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>
    8 	    @%:@include <stddef.h>
    9             @%:@ifdef __GNUC__
   10             @%:@if defined __MINGW_PRINTF_FORMAT
   11             @%:@define PRINTF_ARGS(decl, string_index, first_to_check) \
   12               decl __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, first_to_check)))
   13             @%:@else
   14             @%:@define PRINTF_ARGS(decl, string_index, first_to_check) \
   15               decl __attribute__((format(printf, string_index, first_to_check)))
   16             @%:@endif
   17             @%:@else
   18             @%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl
   19             @%:@endif
   20 	    PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);]],
   21             [[printf("%]${pri}[d", (]$1[)42);
   22              test_sprintf("%]${pri}[d", (]$1[)42);]])],
   23             [rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break])
   24     done)])
   25 AS_IF([test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE], [
   26     AC_DEFINE_UNQUOTED([PRI_]m4_ifval($3,$3,AS_TR_CPP(m4_bpatsubst([$1],[_t$])))[_PREFIX],
   27         "[$rb_cv_pri_prefix_]AS_TR_SH($1)")
   28 ])
   29 ])dnl