~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/stack.m4

  • Committer: lbieber
  • Date: 2010-09-17 01:47:05 UTC
  • mfrom: (1770.1.2 build)
  • Revision ID: lbieber@orisndriz08-20100917014705-zzqek5l4x962z5tg
Merge Stewart - remove the unbalanced my_end() call from drizzledump
Merge Stewart - move math functions into plugin

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_RUN_IFELSE(
4
 
       [AC_LANG_PROGRAM(
5
 
          [[
6
 
            #include <stdlib.h>
7
 
 
8
 
 /* Prevent compiler optimization by HP's compiler, see bug#42213 */
9
 
 #if defined(__HP_cc) || defined (__HP_aCC) || defined (__hpux)
10
 
 #pragma noinline
11
 
 #endif
12
 
 
13
 
 int find_stack_direction ()
14
 
 {
15
 
   static char *addr = 0;
16
 
   auto char dummy;
17
 
   if (addr == 0)
18
 
     {
19
 
       addr = &dummy;
20
 
       return find_stack_direction ();
21
 
     }
22
 
   else
23
 
     return (&dummy > addr) ? 1 : -1;
24
 
 }
25
 
          ]],
26
 
          [[
27
 
   exit (find_stack_direction() < 0);
28
 
          ]]
29
 
       )],
30
 
       [ac_cv_c_stack_direction=1],
31
 
       [ac_cv_c_stack_direction=-1],
32
 
       [ac_cv_c_stack_direction=]
33
 
    )]
34
 
  )
35
 
 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
36
 
])