+2005-03-02 Christopher Faylor <cgf@timesys.com>
+
+ * autoload.cc (std_dll_init): Save and restore fpu control register
+ around LoadAddress to prevent loaded dlls (like msvcrt.dll) from
+ setting unwanted stuff.
+
2005-03-02 Christopher Faylor <cgf@timesys.com>
* cygtls.cc (_cygtls::init_thread): Move exitsock setting later. It
while (InterlockedIncrement (&dll->here));
else if (!dll->handle)
{
+ unsigned fpu_control = 0;
+ __asm__ __volatile__ ("fnstcw %0": "=m" (fpu_control));
if ((h = LoadLibrary (dll->name)) != NULL)
- dll->handle = h;
+ {
+ __asm__ __volatile__ ("fldcw %0": : "m" (fpu_control));
+ dll->handle = h;
+ }
else if (!(func->decoration & 1))
api_fatal ("could not load %s, %E", dll->name);
else
if (!wsock_started)
{
- /* Don't use autoload to load WSAStartup to eliminate recursion. */
int (*wsastartup) (int, WSADATA *);
wsastartup = (int (*)(int, WSADATA *))