summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/autoload.cc
diff options
context:
space:
mode:
authorDave Korn <dave.korn.cygwin@gmail.com>2010-09-11 06:53:28 +0000
committerDave Korn <dave.korn.cygwin@gmail.com>2010-09-11 06:53:28 +0000
commit0f81b5d4bcaa5c840031796d94df9ba6d6fae4d0 (patch)
tree167292d4f6250ddb23f2abfe2660049054117f91 /winsup/cygwin/autoload.cc
parentf7dea7f23347d847b6abd3d8b5f7e1b00f21262f (diff)
downloadcygnal-0f81b5d4bcaa5c840031796d94df9ba6d6fae4d0.tar.gz
cygnal-0f81b5d4bcaa5c840031796d94df9ba6d6fae4d0.tar.bz2
cygnal-0f81b5d4bcaa5c840031796d94df9ba6d6fae4d0.zip
winsup/cygwin/ChangeLog:
* Makefile.in (DLL_OFILES): Add new fenv.o module. (fenv_CFLAGS): New flags definition for fenv.o compile. * autoload.cc (std_dll_init): Use fenv.h functions instead of direct manipulation of x87 FPU registers. * crt0.c (mainCRTStartup): Likewise. * cygwin.din (feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, fetestexcept, fegetround, fesetround, fegetenv, feholdexcept, fesetenv, feupdateenv, fegetprec, fesetprec, feenableexcept, fedisableexcept, fegetexcept, _feinitialise, _fe_dfl_env, _fe_nomask_env): Export new functions and data items. * fenv.cc: New file. * posix.sgml: Update status of newly-implemented APIs. * include/fenv.h: Likewise related header. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r--winsup/cygwin/autoload.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 07272af53..5054f6808 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -11,6 +11,7 @@ details. */
#include "winsup.h"
#include "miscfuncs.h"
+#include "fenv.h"
#define USE_SYS_TYPES_FD_SET
#include <winsock2.h>
@@ -222,13 +223,13 @@ std_dll_init ()
while (InterlockedIncrement (&dll->here));
else if (!dll->handle)
{
- unsigned fpu_control = 0;
- __asm__ __volatile__ ("fnstcw %0": "=m" (fpu_control));
+ fenv_t fpuenv;
+ fegetenv (&fpuenv);
/* http://www.microsoft.com/technet/security/advisory/2269637.mspx */
wcpcpy (wcpcpy (dll_path, windows_system_directory), dll->name);
if ((h = LoadLibraryW (dll_path)) != NULL)
{
- __asm__ __volatile__ ("fldcw %0": : "m" (fpu_control));
+ fesetenv (&fpuenv);
dll->handle = h;
}
else if (!(func->decoration & 1))