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.
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user