summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2004-03-12 12:02:03 +0000
committerbde <bde@FreeBSD.org>2004-03-12 12:02:03 +0000
commit5c7ee701c799c89f8b41b2dadf02cf3d7b6e856a (patch)
tree0e2790073ac0eb72fba247dfe0b4fb87b41ce09b
parent08e8eb2b40c0e5b6b1d511c0a68bd174602757b5 (diff)
downloadFreeBSD-src-5c7ee701c799c89f8b41b2dadf02cf3d7b6e856a.zip
FreeBSD-src-5c7ee701c799c89f8b41b2dadf02cf3d7b6e856a.tar.gz
Initial support for C99's (or is it POSIX.1-2001's?) MATH_ERRNO,
MATH_ERREXCEPTION and math_errhandling, so that C99 applications at least have the possibility of determining that errno is not set for math functions. Set math_errhandling to the non-standard-conforming value of 0 for now to indicate that we don't support either method of reporting errors. We intentionally don't support MATH_ERRNO because errno is a mistake, and we are missing support for MATH_ERREXCEPTION (<fenv.h>, compiler support for <fenv.h>, and actually setting the exception flags correctly).
-rw-r--r--lib/msun/src/math.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h
index 7e91916..842793b 100644
--- a/lib/msun/src/math.h
+++ b/lib/msun/src/math.h
@@ -40,6 +40,12 @@ extern const union __nan_un {
#define INFINITY HUGE_VALF
#define NAN (__nan.__uf)
+#if __ISO_C_VISIBLE >= 1999
+#define MATH_ERRNO 1
+#define MATH_ERREXCEPT 2
+#define math_errhandling 0
+#endif
+
/* Symbolic constants to classify floating point numbers. */
#define FP_INFINITE 0x01
#define FP_NAN 0x02
OpenPOWER on IntegriCloud