diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2012-09-13 20:03:01 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2012-09-13 20:03:01 (GMT) |
commit | 9d29fc1ebfbb48cc19bf87541750abfbaeab3c31 (patch) | |
tree | 45d503821cab1057b68636dc6df4a430dc4c1091 | |
parent | c02b64e20cd435142d5924015fadc8dbcd19aa43 (diff) | |
download | tcl-9d29fc1ebfbb48cc19bf87541750abfbaeab3c31.zip tcl-9d29fc1ebfbb48cc19bf87541750abfbaeab3c31.tar.gz tcl-9d29fc1ebfbb48cc19bf87541750abfbaeab3c31.tar.bz2 |
Make compilation of the fp control changes possible with MinGW.
-rw-r--r-- | win/tclWinThrd.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index 86ff6a5..21d422f 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -160,7 +160,7 @@ TclWinThreadStart( * from TclpThreadCreate */ { WinThread *winThreadPtr = (WinThread *) lpParameter; - unsigned int fpmask = _MCW_EM | _MCW_RC | _MCW_PC | _MCW_DN; + unsigned int fpmask; LPTHREAD_START_ROUTINE lpOrigStartAddress; LPVOID lpOrigParameter; @@ -168,6 +168,12 @@ TclWinThreadStart( return TCL_ERROR; } + fpmask = _MCW_EM | _MCW_RC | _MCW_PC; + +#if defined(_MSC_VER) && _MSC_VER >= 1200 + fpmask |= _MCW_DN; +#endif + _controlfp(winThreadPtr->fpControl, fpmask); lpOrigStartAddress = winThreadPtr->lpStartAddress; @@ -207,7 +213,7 @@ TclpThreadCreate(idPtr, proc, clientData, stackSize, flags) HANDLE tHandle; winThreadPtr = (WinThread *)ckalloc(sizeof(WinThread)); - winThreadPtr->lpStartAddress = proc; + winThreadPtr->lpStartAddress = (LPTHREAD_START_ROUTINE) proc; winThreadPtr->lpParameter = clientData; winThreadPtr->fpControl = _controlfp(0, 0); @@ -215,7 +221,8 @@ TclpThreadCreate(idPtr, proc, clientData, stackSize, flags) #if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__BORLANDC__) tHandle = (HANDLE) _beginthreadex(NULL, (unsigned) stackSize, - TclWinThreadStart, winThreadPtr, 0, (unsigned *)idPtr); + (Tcl_ThreadCreateProc*) TclWinThreadStart, winThreadPtr, + 0, (unsigned *)idPtr); #else tHandle = CreateThread(NULL, (DWORD) stackSize, TclWinThreadStart, winThreadPtr, 0, (LPDWORD)idPtr); |