208 |
# But we include them only after the EXPRESSION has been evaluated. |
# 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([$1 |
[AC_LANG_PROGRAM([$1 |
211 |
unsigned long conftestval () { return $2; } |
long longval () { return $2; } |
212 |
|
unsigned long ulongval () { return $2; } |
213 |
@%:@include <stdio.h> |
@%:@include <stdio.h> |
214 |
@%:@include <stdlib.h>], |
@%:@include <stdlib.h>], |
215 |
[ |
[ |
216 |
FILE *f = fopen ("conftest.val", "w"); |
FILE *f = fopen ("conftest.val", "w"); |
217 |
if (f) |
if (! f) |
218 |
|
exit (1); |
219 |
|
if (($2) < 0) |
220 |
{ |
{ |
221 |
unsigned long i = conftestval (); |
long i = longval (); |
222 |
if (0 <= ($2) && i == ($2)) |
if (i != ($2)) |
223 |
{ |
exit (1); |
224 |
fprintf (f, "%lu\n", i); |
fprintf (f, "%ld\n", i); |
|
if (! ferror (f) && fclose (f) == 0) |
|
|
exit (0); |
|
|
} |
|
225 |
} |
} |
226 |
exit (1); |
else |
227 |
|
{ |
228 |
|
unsigned long i = ulongval (); |
229 |
|
if (i != ($2)) |
230 |
|
exit (1); |
231 |
|
fprintf (f, "%lu\n", i); |
232 |
|
} |
233 |
|
exit (ferror (f) || fclose (f) != 0); |
234 |
])]) |
])]) |
235 |
|
|
236 |
|
|