summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-01-25 23:06:15 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-01-25 23:06:15 (GMT)
commitb298791bcca7b9d9ffc1af32bf415e7c5dcca498 (patch)
treee486dce4ce3c736d0988205820ca31c0ce75961e /unix
parent0bd132708f79e0993a249078c60184ec6d2d52b7 (diff)
downloadtcl-b298791bcca7b9d9ffc1af32bf415e7c5dcca498.zip
tcl-b298791bcca7b9d9ffc1af32bf415e7c5dcca498.tar.gz
tcl-b298791bcca7b9d9ffc1af32bf415e7c5dcca498.tar.bz2
Backport of part of FreeBSD port
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixInit.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index 13a8cee..34c36fb 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -7,7 +7,7 @@
* Copyright (c) 1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclUnixInit.c,v 1.34.2.11 2005/11/03 16:16:29 dgp Exp $
+ * RCS: @(#) $Id: tclUnixInit.c,v 1.34.2.12 2006/01/25 23:06:16 dkf Exp $
*/
#if defined(HAVE_COREFOUNDATION)
@@ -19,7 +19,7 @@
#ifdef HAVE_LANGINFO
#include <langinfo.h>
#endif
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) && defined(__GNUC__)
# include <floatingpoint.h>
#endif
#if defined(__bsdi__)
@@ -204,7 +204,14 @@ TclpInitPlatform()
(void) signal(SIGPIPE, SIG_IGN);
#endif /* SIGPIPE */
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) && defined(__GNUC__)
+ /*
+ * Adjust the rounding mode to be more conventional. Note that FreeBSD
+ * only provides the __fpsetreg() used by the following two for the GNU
+ * Compiler. When using, say, Intel's icc they break. (Partially based on
+ * patch in BSD ports system from root@celsius.bychok.com)
+ */
+
fpsetround(FP_RN);
fpsetmask(0L);
#endif