"Fossies" - the Fresh Open Source Software Archive

Member "ruby-2.7.4/tool/m4/ruby_stack_grow_direction.m4" (7 Jul 2021, 715 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_stack_grow_direction.m4": 2.7.3_vs_2.7.4.

    1 # -*- Autoconf -*-
    2 AC_DEFUN([RUBY_STACK_GROW_DIRECTION], [
    3     AS_VAR_PUSHDEF([stack_grow_dir], [rb_cv_stack_grow_dir_$1])
    4     AC_CACHE_CHECK(stack growing direction on $1, stack_grow_dir, [
    5 AS_CASE(["$1"],
    6 [m68*|x86*|x64|i?86|ppc*|sparc*|alpha*], [ $2=-1],
    7 [hppa*], [ $2=+1],
    8 [
    9   AC_RUN_IFELSE([AC_LANG_SOURCE([[
   10 /* recurse to get rid of inlining */
   11 static int
   12 stack_growup_p(addr, n)
   13     volatile int *addr, n;
   14 {
   15     volatile int end;
   16     if (n > 0)
   17 	return *addr = stack_growup_p(addr, n - 1);
   18     else
   19 	return (&end > addr);
   20 }
   21 int main()
   22 {
   23     int x;
   24     return stack_growup_p(&x, 10);
   25 }
   26 ]])],[$2=-1],[$2=+1],[$2=0])
   27   ])
   28 eval stack_grow_dir=\$$2])
   29 eval $2=\$stack_grow_dir
   30 AS_VAR_POPDEF([stack_grow_dir])])dnl