The R Project SVN R

Rev

Rev 22614 | Rev 35450 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22614 Rev 23382
Line 89... Line 89...
89
HINSTANCE R_loadLibrary(const char *path, int asLocal, int now)
89
HINSTANCE R_loadLibrary(const char *path, int asLocal, int now)
90
{
90
{
91
    HINSTANCE tdlh;
91
    HINSTANCE tdlh;
92
    unsigned int dllcw, rcw;
92
    unsigned int dllcw, rcw;
93
 
93
 
94
    rcw = _controlfp(0,0) & ~_MCW_IC;  /* Infinity control is ignored by the FPU */
94
    rcw = _controlfp(0,0) & ~_MCW_IC;  /* Infinity control is ignored */
95
    _clearfp();
95
    _clearfp();
96
    tdlh = LoadLibrary(path);
96
    tdlh = LoadLibrary(path);
97
    dllcw = _controlfp(0,0) & ~_MCW_IC;
97
    dllcw = _controlfp(0,0) & ~_MCW_IC;
98
    if (dllcw != rcw) {
98
    if (dllcw != rcw) {
99
		warning("DLL attempted to change FPU control word from %x to %x",rcw,dllcw);
-
 
100
		_controlfp(rcw, _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC);
99
		_controlfp(rcw, _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC);
-
 
100
		if (LOGICAL(GetOption(install("warn.FPU"), R_NilValue))[0])
-
 
101
			warning("DLL attempted to change FPU control word from %x to %x",
-
 
102
					rcw,dllcw);
101
	}
103
	}
102
    return(tdlh);
104
    return(tdlh);
103
}
105
}
104
 
106
 
105
static DL_FUNC getRoutine(DllInfo *info, char const *name)
107
static DL_FUNC getRoutine(DllInfo *info, char const *name)