/[autoconf]/autoconf/lib/autoconf/c.m4
ViewVC logotype

Diff of /autoconf/lib/autoconf/c.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.153 by akim, Wed Sep 5 08:46:53 2001 UTC revision 1.154 by eggert, Mon Sep 17 21:49:30 2001 UTC
# Line 204  _array_ @<:@0@:>@ = 0 Line 204  _array_ @<:@0@:>@ = 0
204    
205  # AC_LANG_INT_SAVE(C)(PROLOGUE, EXPRESSION)  # AC_LANG_INT_SAVE(C)(PROLOGUE, EXPRESSION)
206  # -----------------------------------------  # -----------------------------------------
207  # We need `stdio.h' to open a `FILE', so the prologue defaults to the  # We need `stdio.h' to open a `FILE' and `stdlib.h' for `exit'.
208  # inclusion of `stdio.h'.  # But we include them only after the EXPRESSION has been evaluated.
209  m4_define([AC_LANG_INT_SAVE(C)],  m4_define([AC_LANG_INT_SAVE(C)],
210  [AC_LANG_PROGRAM([m4_default([$1], [@%:@include <stdio.h>])],  [AC_LANG_PROGRAM([$1
211  [FILE *f = fopen ("conftest.val", "w");  unsigned long conftestval () { return $2; }
212  if (!f)  @%:@include <stdio.h>
213    @%:@include <stdlib.h>],
214    [
215      FILE *f = fopen ("conftest.val", "w");
216      if (f)
217        {
218          unsigned long i = conftestval ();
219          if (0 <= ($2) && i == ($2))
220            {
221              fprintf (f, "%lu\n", i);
222              if (! ferror (f) && fclose (f) == 0)
223                exit (0);
224            }
225        }
226    exit (1);    exit (1);
227  fprintf (f, "%d", ($2));  ])])
 fclose (f);])])  
228    
229    
230  # ----------------- #  # ----------------- #

Legend:
Removed from v.1.153  
changed lines
  Added in v.1.154

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26