]> www.ginac.de Git - cln.git/blobdiff - autoconf/floatparam.c
Fix double_approx(const cl_RA& x) on 64-Bit platforms.
[cln.git] / autoconf / floatparam.c
index a88637165a3912398d90212d479a1894d4498746..66b4d6122dac34628bfd23431d61ac5bfee985fd 100644 (file)
@@ -5,11 +5,6 @@
 
 #include <stdio.h>
 
-#if !(defined(__STDC__) || defined(__cplusplus))
-/* Only for use in function parameter lists and as function return type. */
-#define void
-#endif
-
 typedef int boolean;
 #define TRUE  1
 #define FALSE 0
@@ -29,7 +24,7 @@ static void header (void)
 }
 
 #define check(type,typeprefix,typestr,equalfn,mainfn)  \
-static boolean equalfn (type* x, type* y);                             \
+static boolean equalfn (volatile type* x, volatile type* y);           \
 static void mainfn (void)                                              \
 {                                                                      \
   int mant_bits;                                                       \
@@ -79,7 +74,10 @@ static void mainfn (void)                                            \
   }                                                                    \
   printf("\n");                                                                \
 }                                                                      \
-static boolean equalfn (type* x, type* y) { return *x == *y; }         \
+static boolean equalfn (volatile type* x, volatile type* y)            \
+{                                                                      \
+  return *x == *y;                                                     \
+}                                                                      \
 
 check(float,"float","float",equal_float,main_float)
 check(double,"double","double",equal_double,main_double)
@@ -116,6 +114,6 @@ int main()
 #endif
   flipped_double();
 
-  if (ferror(stdout)) return 1;
+  if (ferror(stdout) || fclose(stdout)) return 1;
   return 0;
 }