msvcr120: Set errno in log2.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2017-07-17 22:33:52 -06:00 committed by Alexandre Julliard
parent 31b835d0e0
commit b1230c3484
1 changed files with 4 additions and 0 deletions

View File

@ -2488,6 +2488,8 @@ LDOUBLE CDECL MSVCR120_log1pl(LDOUBLE x)
*/
double CDECL MSVCR120_log2(double x)
{
if (x < 0) *MSVCRT__errno() = MSVCRT_EDOM;
else if (x == 0) *MSVCRT__errno() = MSVCRT_ERANGE;
#ifdef HAVE_LOG2
return log2(x);
#else
@ -2500,6 +2502,8 @@ double CDECL MSVCR120_log2(double x)
*/
float CDECL MSVCR120_log2f(float x)
{
if (x < 0) *MSVCRT__errno() = MSVCRT_EDOM;
else if (x == 0) *MSVCRT__errno() = MSVCRT_ERANGE;
#ifdef HAVE_LOG2F
return log2f(x);
#else