isnan: Add support for TinyCC
authorLudovic Courtès <ludo@gnu.org>
Fri, 15 Oct 2010 13:43:57 +0000 (15:43 +0200)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 15 Oct 2010 16:24:03 +0000 (09:24 -0700)
Without this patch, tcc bails out:

  isnan.c:132: division by zero in constant

Tested with tcc 0.9.25 on x86_64-linux-gnu.

* lib/isnan.c (FUNC): Treat TinyCC (`__TINYC__') like `__SUNPRO_C' & co.

ChangeLog
lib/isnan.c

index 4e36a0f..fcdc628 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-15  Ludovic Courtès  <ludo@gnu.org>
+
+       * lib/isnan.c (FUNC): Treat TinyCC (`__TINYC__') like `__SUNPRO_C'
+       & co.
+
 2010-10-14  Bruno Haible  <bruno@clisp.org>
 
        vasnprintf: Don't set errno to 0.
index ee9fa8b..ddad7fb 100644 (file)
@@ -117,7 +117,8 @@ FUNC (DOUBLE x)
 # else
   /* Be careful to not do any floating-point operation on x, such as x == x,
      because x may be a signaling NaN.  */
-#  if defined __SUNPRO_C || defined __DECC || (defined __sgi && !defined __GNUC__)
+#  if defined __TINYC__ || defined __SUNPRO_C || defined __DECC \
+      || (defined __sgi && !defined __GNUC__)
   /* The Sun C 5.0 compilers and the Compaq (ex-DEC) 6.4 compilers don't
      recognize the initializers as constant expressions.  The latter compiler
      also fails when constant-folding 0.0 / 0.0 even when constant-folding is