~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/drizzle_stack_direction.m4

  • Committer: Monty Taylor
  • Date: 2009-06-30 18:09:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1083.
  • Revision ID: mordred@inaugust.com-20090630180907-r24363hlhgxg4cbw
Whole boat-load of build fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_DEFUN([DRIZZLE_STACK_DIRECTION],
 
2
 [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
 
3
 [AC_TRY_RUN([#include <stdlib.h>
 
4
 int find_stack_direction ()
 
5
 {
 
6
   static char *addr = 0;
 
7
   auto char dummy;
 
8
   if (addr == 0)
 
9
     {
 
10
       addr = &dummy;
 
11
       return find_stack_direction ();
 
12
     }
 
13
   else
 
14
     return (&dummy > addr) ? 1 : -1;
 
15
 }
 
16
 int main ()
 
17
 {
 
18
   exit (find_stack_direction() < 0);
 
19
 }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
 
20
   ac_cv_c_stack_direction=)])
 
21
 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
 
22
])dnl