Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys C99: provide FLT_EVAL_METHOD.



details:   https://anonhg.NetBSD.org/src/rev/8328408d52c1
branches:  trunk
changeset: 553893:8328408d52c1
user:      kleink <kleink%NetBSD.org@localhost>
date:      Wed Oct 22 16:18:48 2003 +0000

description:
C99: provide FLT_EVAL_METHOD.

diffstat:

 sys/arch/vax/include/float.h |  20 +++++++++++++++++++-
 sys/sys/float_ieee754.h      |  16 +++++++++++++++-
 2 files changed, 34 insertions(+), 2 deletions(-)

diffs (74 lines):

diff -r 2ed99fc85559 -r 8328408d52c1 sys/arch/vax/include/float.h
--- a/sys/arch/vax/include/float.h      Wed Oct 22 16:10:03 2003 +0000
+++ b/sys/arch/vax/include/float.h      Wed Oct 22 16:18:48 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: float.h,v 1.6 2003/08/07 16:30:09 agc Exp $    */
+/*     $NetBSD: float.h,v 1.7 2003/10/22 16:18:48 kleink Exp $ */
 
 /*
  * Copyright (c) 1989 Regents of the University of California.
@@ -34,9 +34,27 @@
 #ifndef _VAX_FLOAT_H_
 #define _VAX_FLOAT_H_
 
+#include <sys/cdefs.h>
+#include <sys/featuretest.h>
+
 #define FLT_RADIX      2               /* b */
 #define FLT_ROUNDS     1               /* FP addition rounds to nearest */
 
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+    !defined(_XOPEN_SOURCE) || \
+    ((__STDC_VERSION__ - 0) >= 199901L) || \
+    ((_POSIX_C_SOURCE - 0) >= 200112L) || \
+    ((_XOPEN_SOURCE  - 0) >= 600) || \
+    defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+#if __GNUC_PREREQ__(3, 3)
+#define        FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#else
+#define        FLT_EVAL_METHOD 0               /* evaluate all operations and
+                                          constants just to the range and
+                                          precision of the type */
+#endif /* GCC >= 3.3 */
+#endif /* !defined(_ANSI_SOURCE) && ... */
+                                          
 #define FLT_MANT_DIG   24              /* p */
 #define FLT_EPSILON    1.19209290E-7F  /* b**(1-p) */
 #define FLT_DIG                6               /* floor((p-1)*log10(b))+(b == 10) */
diff -r 2ed99fc85559 -r 8328408d52c1 sys/sys/float_ieee754.h
--- a/sys/sys/float_ieee754.h   Wed Oct 22 16:10:03 2003 +0000
+++ b/sys/sys/float_ieee754.h   Wed Oct 22 16:18:48 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: float_ieee754.h,v 1.2 2003/08/07 16:34:04 agc Exp $    */
+/*     $NetBSD: float_ieee754.h,v 1.3 2003/10/22 16:18:48 kleink Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -35,6 +35,7 @@
 #define _SYS_FLOAT_IEEE754_H_
 
 #include <sys/cdefs.h>
+#include <sys/featuretest.h>
 
 #ifndef FLT_ROUNDS
 __BEGIN_DECLS
@@ -43,6 +44,19 @@
 #define FLT_ROUNDS     __flt_rounds()
 #endif
 
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+    !defined(_XOPEN_SOURCE) || \
+    ((__STDC_VERSION__ - 0) >= 199901L) || \
+    ((_POSIX_C_SOURCE - 0) >= 200112L) || \
+    ((_XOPEN_SOURCE  - 0) >= 600) || \
+    defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+#ifndef FLT_EVAL_METHOD
+#if __GNUC_PREREQ__(3, 3)
+#define        FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#endif /* GCC >= 3.3 */
+#endif /* defined(FLT_EVAL_METHOD) */
+#endif /* !defined(_ANSI_SOURCE) && ... */
+
 #define FLT_RADIX      2               /* b */
 
 #define FLT_MANT_DIG   24              /* p */



Home | Main Index | Thread Index | Old Index