Hi Cyprien,

Cyprien Nicolas <[email protected]> skribis:

> That define value is computed using the find_stack_direction function
> defined in configure.in:
>
> int
> find_stack_direction ()
> {
>   static char *addr = 0;
>   auto char dummy;
>   if (addr == 0)
>     {
>       addr = &dummy;
>       return find_stack_direction ();
>     }
>   else
>     return (&dummy > addr) ? 1 : -1;
> }
>
> int
> main ()
> {
>   return find_stack_direction () < 0;
> }

Guile 2.0 uses this instead:

--8<---------------cut here---------------start------------->8---
int
find_stack_direction (int *addr, int depth)
{
  int dir, dummy = 0;
  if (! addr)
    addr = &dummy;
  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
  return dir + dummy;
}

int
main (int argc, char **argv)
{
  return find_stack_direction (0, argc + !argv + 20) < 0;
}
--8<---------------cut here---------------end--------------->8---

Can you check whether it works for you?

(See also
<http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00041.html>
on that topic.)

Thanks,
Ludo’.



Reply via email to