Skip to content
Tcl Source Code Attachment Details
Login

Attachment Details

Overview

Artifact ID: f6d91bebae174c2f3e3f38b002e39f621c3fb509
Ticket: 1061224fffffffffffffffffffffffffffffffff
Date: 2004-11-06 06:55:49
User: davygrvy
Artifact Attached: f8c08c8fed1a00653f6183a2a0acfc56264a0dba
Filename:patch.txt
Description:ExprUnaryFunc() change
Content:
*** generic/tclExecute.c	2 Nov 2004 15:32:06 -0000	1.166
--- generic/tclExecute.c	5 Nov 2004 23:51:22 -0000
***************
*** 5563,5569 ****
  {
      register Tcl_Obj *valuePtr;
      double d, dResult;
!     
      double (*func) _ANSI_ARGS_((double)) =
  	(double (*)_ANSI_ARGS_((double))) clientData;
  
--- 5563,5572 ----
  {
      register Tcl_Obj *valuePtr;
      double d, dResult;
! #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MSVCRT__))
!     int mask;
! #endif
! 
      double (*func) _ANSI_ARGS_((double)) =
  	(double (*)_ANSI_ARGS_((double))) clientData;
  
***************
*** 5581,5588 ****
--- 5584,5599 ----
      GET_DOUBLE_VALUE(d, valuePtr, valuePtr->typePtr);
  
      errno = 0;
+ #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MSVCRT__))
+     mask = _controlfp(0, 0);
+     _controlfp(_CW_DEFAULT, _MCW_EM);
+ #endif
      dResult = (*func)(d);
      if ((errno != 0) || IS_NAN(dResult) || IS_INF(dResult)) {
+ #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MSVCRT__))
+     _clear87();
+     _controlfp(mask, _MCW_EM);
+ #endif
  	TclExprFloatError(interp, dResult);
  	return TCL_ERROR;
      }