Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
547ba7a1
Commit
547ba7a1
authored
Dec 08, 2014
by
Martin Storsjo
Committed by
Alexandre Julliard
Dec 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcr120: Implement more C99 math functions.
parent
589f58d8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
468 additions
and
34 deletions
+468
-34
configure
configure
+34
-2
configure.ac
configure.ac
+23
-2
msvcr120.spec
dlls/msvcr120/msvcr120.spec
+30
-30
math.c
dlls/msvcrt/math.c
+321
-0
config.h.in
include/config.h.in
+60
-0
No files found.
configure
View file @
547ba7a1
...
...
@@ -16345,8 +16345,6 @@ $as_echo "#define HAVE_ISFINITE 1" >>confdefs.h
fi
ac_save_LIBS
=
"
$LIBS
"
LIBS
=
"
$LIBS
-lm"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for isinf"
>
&5
$as_echo_n
"checking for isinf... "
>
&6
;
}
if
${
ac_cv_have_isinf
+
:
}
false
;
then
:
...
...
@@ -16412,6 +16410,40 @@ then
$as_echo
"#define HAVE_ISNAN 1"
>>
confdefs.h
fi
for
ac_func
in
\
cbrt
\
cbrtf
\
exp2
\
exp2f
\
llrint
\
llrintf
\
llround
\
llroundf
\
log2
\
log2f
\
lrint
\
lrintf
\
lround
\
lroundf
\
rint
\
rintf
\
round
\
roundf
\
trunc
\
truncf
do
:
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
ac_fn_c_check_func
"
$LINENO
"
"
$ac_func
"
"
$as_ac_var
"
if
eval test
\"
x
\$
"
$as_ac_var
"
\"
=
x
"yes"
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define `
$as_echo
"HAVE_
$ac_func
" |
$as_tr_cpp
` 1
_ACEOF
fi
done
LIBS
=
"
$ac_save_LIBS
"
...
...
configure.ac
View file @
547ba7a1
...
...
@@ -2556,8 +2556,6 @@ then
fi
dnl Check for isinf
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lm"
AC_CACHE_CHECK([for isinf], ac_cv_have_isinf,
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; return isinf(f)]])],[ac_cv_have_isinf="yes"],[ac_cv_have_isinf="no"]))
if test "$ac_cv_have_isinf" = "yes"
...
...
@@ -2572,6 +2570,29 @@ if test "$ac_cv_have_isnan" = "yes"
then
AC_DEFINE(HAVE_ISNAN, 1, [Define to 1 if you have the `isnan' function.])
fi
AC_CHECK_FUNCS(\
cbrt \
cbrtf \
exp2 \
exp2f \
llrint \
llrintf \
llround \
llroundf \
log2 \
log2f \
lrint \
lrintf \
lround \
lroundf \
rint \
rintf \
round \
roundf \
trunc \
truncf
)
LIBS="$ac_save_LIBS"
dnl *** check for the need to define platform-specific symbols
...
...
dlls/msvcr120/msvcr120.spec
View file @
547ba7a1
...
...
@@ -2058,9 +2058,9 @@
@ stub catanhf
@ stub catanhl
@ stub catanl
@
stub
cbrt
@
stub
cbrtf
@
stub
cbrtl
@
cdecl cbrt(double) MSVCR120_
cbrt
@
cdecl cbrtf(float) MSVCR120_
cbrtf
@
cdecl cbrtl(double) MSVCR120_
cbrtl
@ stub ccos
@ stub ccosf
@ stub ccosh
...
...
@@ -2127,9 +2127,9 @@
@ stub erfl
@ cdecl exit(long) MSVCRT_exit
@ cdecl exp(double) MSVCRT_exp
@
stub
exp2
@
stub
exp2f
@
stub
exp2l
@
cdecl exp2(double) MSVCR120_
exp2
@
cdecl exp2f(float) MSVCR120_
exp2f
@
cdecl exp2l(double) MSVCR120_
exp2l
@ cdecl -arch=arm,x86_64 expf(float) MSVCRT_expf
@ stub expm1
@ stub expm1f
...
...
@@ -2245,12 +2245,12 @@
@ stub lgammal
@ cdecl -ret64 llabs(int64) MSVCRT_llabs
@ stub lldiv
@
stub
llrint
@
stub
llrintf
@
stub
llrintl
@
stub
llround
@
stub
llroundf
@
stub
llroundl
@
cdecl -ret64 llrint(double) MSVCR120_
llrint
@
cdecl -ret64 llrintf(float) MSVCR120_
llrintf
@
cdecl -ret64 llrintl(double) MSVCR120_
llrintl
@
cdecl -ret64 llround(double) MSVCR120_
llround
@
cdecl -ret64 llroundf(float) MSVCR120_
llroundf
@
cdecl -ret64 llroundl(double) MSVCR120_
llroundl
@ cdecl localeconv() MSVCRT_localeconv
@ cdecl log(double) MSVCRT_log
@ cdecl -arch=arm,x86_64 logf(float) MSVCRT_logf
...
...
@@ -2259,19 +2259,19 @@
@ stub log1p
@ stub log1pf
@ stub log1pl
@
stub
log2
@
stub
log2f
@
stub
log2l
@
cdecl log2(double) MSVCR120_
log2
@
cdecl log2f(float) MSVCR120_
log2f
@
cdecl log2l(double) MSVCR120_
log2l
@ stub logb
@ stub logbf
@ stub logbl
@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp
@
stub
lrint
@
stub
lrintf
@
stub
lrintl
@
stub
lround
@
stub
lroundf
@
stub
lroundl
@
cdecl lrint(double) MSVCR120_
lrint
@
cdecl lrintf(float) MSVCR120_
lrintf
@
cdecl lrintl(double) MSVCR120_
lrintl
@
cdecl lround(double) MSVCR120_
lround
@
cdecl lroundf(float) MSVCR120_
lroundf
@
cdecl lroundl(double) MSVCR120_
lroundl
@ cdecl malloc(long) MSVCRT_malloc
@ cdecl mblen(ptr long) MSVCRT_mblen
@ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen
...
...
@@ -2330,12 +2330,12 @@
@ stub remquol
@ cdecl rename(str str) MSVCRT_rename
@ cdecl rewind(ptr) MSVCRT_rewind
@
stub
rint
@
stub
rintf
@
stub
rintl
@
stub
round
@
stub
roundf
@
stub
roundl
@
cdecl rint(double) MSVCR120_
rint
@
cdecl rintf(float) MSVCR120_
rintf
@
cdecl rintl(double) MSVCR120_
rintl
@
cdecl round(double) MSVCR120_
round
@
cdecl roundf(float) MSVCR120_
roundf
@
cdecl roundl(double) MSVCR120_
roundl
@ stub scalbln
@ stub scalblnf
@ stub scalblnl
...
...
@@ -2414,9 +2414,9 @@
@ stub towctrans
@ cdecl towlower(long) MSVCRT_towlower
@ cdecl towupper(long) MSVCRT_towupper
@
stub
trunc
@
stub
truncf
@
stub
truncl
@
cdecl trunc(double) MSVCR120_
trunc
@
cdecl truncf(float) MSVCR120_
truncf
@
cdecl truncl(double) MSVCR120_
truncl
@ cdecl ungetc(long ptr) MSVCRT_ungetc
@ cdecl ungetwc(long ptr) MSVCRT_ungetwc
@ cdecl vfprintf(ptr str ptr) MSVCRT_vfprintf
...
...
dlls/msvcrt/math.c
View file @
547ba7a1
...
...
@@ -39,6 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
#endif
typedef
int
(
CDECL
*
MSVCRT_matherr_func
)(
struct
MSVCRT__exception
*
);
typedef
double
LDOUBLE
;
/* long double is just a double */
static
MSVCRT_matherr_func
MSVCRT_default_matherr_func
=
NULL
;
...
...
@@ -2205,3 +2206,323 @@ void __cdecl __libm_sse2_sqrt_precise(void)
}
#endif
/* __i386__ */
/*********************************************************************
* cbrt (MSVCR120.@)
*/
double
CDECL
MSVCR120_cbrt
(
double
x
)
{
#ifdef HAVE_CBRT
return
cbrt
(
x
);
#else
return
x
<
0
?
-
pow
(
-
x
,
1
.
0
/
3
.
0
)
:
pow
(
x
,
1
.
0
/
3
.
0
);
#endif
}
/*********************************************************************
* cbrtf (MSVCR120.@)
*/
float
CDECL
MSVCR120_cbrtf
(
float
x
)
{
#ifdef HAVE_CBRTF
return
cbrtf
(
x
);
#else
return
MSVCR120_cbrt
(
x
);
#endif
}
/*********************************************************************
* cbrtl (MSVCR120.@)
*/
LDOUBLE
CDECL
MSVCR120_cbrtl
(
LDOUBLE
x
)
{
return
MSVCR120_cbrt
(
x
);
}
/*********************************************************************
* exp2 (MSVCR120.@)
*/
double
CDECL
MSVCR120_exp2
(
double
x
)
{
#ifdef HAVE_EXP2
return
exp2
(
x
);
#else
return
pow
(
2
,
x
);
#endif
}
/*********************************************************************
* exp2f (MSVCR120.@)
*/
float
CDECL
MSVCR120_exp2f
(
float
x
)
{
#ifdef HAVE_EXP2F
return
exp2f
(
x
);
#else
return
MSVCR120_exp2
(
x
);
#endif
}
/*********************************************************************
* exp2l (MSVCR120.@)
*/
LDOUBLE
CDECL
MSVCR120_exp2l
(
LDOUBLE
x
)
{
return
MSVCR120_exp2
(
x
);
}
/*********************************************************************
* log2 (MSVCR120.@)
*/
double
CDECL
MSVCR120_log2
(
double
x
)
{
#ifdef HAVE_LOG2
return
log2
(
x
);
#else
return
log
(
x
)
/
log
(
2
);
#endif
}
/*********************************************************************
* log2f (MSVCR120.@)
*/
float
CDECL
MSVCR120_log2f
(
float
x
)
{
#ifdef HAVE_LOG2F
return
log2f
(
x
);
#else
return
MSVCR120_log2
(
x
);
#endif
}
/*********************************************************************
* log2l (MSVCR120.@)
*/
LDOUBLE
CDECL
MSVCR120_log2l
(
LDOUBLE
x
)
{
return
MSVCR120_log2
(
x
);
}
/*********************************************************************
* rint (MSVCR120.@)
*/
double
CDECL
MSVCR120_rint
(
double
x
)
{
#ifdef HAVE_RINT
return
rint
(
x
);
#else
return
x
>=
0
?
floor
(
x
+
0
.
5
)
:
ceil
(
x
-
0
.
5
);
#endif
}
/*********************************************************************
* rintf (MSVCR120.@)
*/
float
CDECL
MSVCR120_rintf
(
float
x
)
{
#ifdef HAVE_RINTF
return
rintf
(
x
);
#else
return
MSVCR120_rint
(
x
);
#endif
}
/*********************************************************************
* rintl (MSVCR120.@)
*/
LDOUBLE
CDECL
MSVCR120_rintl
(
LDOUBLE
x
)
{
return
MSVCR120_rint
(
x
);
}
/*********************************************************************
* lrint (MSVCR120.@)
*/
MSVCRT_long
CDECL
MSVCR120_lrint
(
double
x
)
{
#ifdef HAVE_LRINT
return
lrint
(
x
);
#else
return
MSVCR120_rint
(
x
);
#endif
}
/*********************************************************************
* lrintf (MSVCR120.@)
*/
MSVCRT_long
CDECL
MSVCR120_lrintf
(
float
x
)
{
#ifdef HAVE_LRINTF
return
lrintf
(
x
);
#else
return
MSVCR120_lrint
(
x
);
#endif
}
/*********************************************************************
* lrintl (MSVCR120.@)
*/
MSVCRT_long
CDECL
MSVCR120_lrintl
(
LDOUBLE
x
)
{
return
MSVCR120_lrint
(
x
);
}
/*********************************************************************
* llrint (MSVCR120.@)
*/
MSVCRT_longlong
CDECL
MSVCR120_llrint
(
double
x
)
{
#ifdef HAVE_LLRINT
return
llrint
(
x
);
#else
return
MSVCR120_rint
(
x
);
#endif
}
/*********************************************************************
* llrintf (MSVCR120.@)
*/
MSVCRT_longlong
CDECL
MSVCR120_llrintf
(
float
x
)
{
#ifdef HAVE_LLRINTF
return
llrintf
(
x
);
#else
return
MSVCR120_llrint
(
x
);
#endif
}
/*********************************************************************
* rintl (MSVCR120.@)
*/
MSVCRT_longlong
CDECL
MSVCR120_llrintl
(
LDOUBLE
x
)
{
return
MSVCR120_llrint
(
x
);
}
/*********************************************************************
* round (MSVCR120.@)
*/
double
CDECL
MSVCR120_round
(
double
x
)
{
#ifdef HAVE_ROUND
return
round
(
x
);
#else
return
MSVCR120_rint
(
x
);
#endif
}
/*********************************************************************
* roundf (MSVCR120.@)
*/
float
CDECL
MSVCR120_roundf
(
float
x
)
{
#ifdef HAVE_ROUNDF
return
roundf
(
x
);
#else
return
MSVCR120_round
(
x
);
#endif
}
/*********************************************************************
* roundl (MSVCR120.@)
*/
LDOUBLE
CDECL
MSVCR120_roundl
(
LDOUBLE
x
)
{
return
MSVCR120_round
(
x
);
}
/*********************************************************************
* lround (MSVCR120.@)
*/
MSVCRT_long
CDECL
MSVCR120_lround
(
double
x
)
{
#ifdef HAVE_LROUND
return
lround
(
x
);
#else
return
MSVCR120_round
(
x
);
#endif
}
/*********************************************************************
* lroundf (MSVCR120.@)
*/
MSVCRT_long
CDECL
MSVCR120_lroundf
(
float
x
)
{
#ifdef HAVE_LROUNDF
return
lroundf
(
x
);
#else
return
MSVCR120_lround
(
x
);
#endif
}
/*********************************************************************
* lroundl (MSVCR120.@)
*/
MSVCRT_long
CDECL
MSVCR120_lroundl
(
LDOUBLE
x
)
{
return
MSVCR120_lround
(
x
);
}
/*********************************************************************
* llround (MSVCR120.@)
*/
MSVCRT_longlong
CDECL
MSVCR120_llround
(
double
x
)
{
#ifdef HAVE_LLROUND
return
llround
(
x
);
#else
return
MSVCR120_round
(
x
);
#endif
}
/*********************************************************************
* llroundf (MSVCR120.@)
*/
MSVCRT_longlong
CDECL
MSVCR120_llroundf
(
float
x
)
{
#ifdef HAVE_LLROUNDF
return
llroundf
(
x
);
#else
return
MSVCR120_llround
(
x
);
#endif
}
/*********************************************************************
* roundl (MSVCR120.@)
*/
MSVCRT_longlong
CDECL
MSVCR120_llroundl
(
LDOUBLE
x
)
{
return
MSVCR120_llround
(
x
);
}
/*********************************************************************
* trunc (MSVCR120.@)
*/
double
CDECL
MSVCR120_trunc
(
double
x
)
{
#ifdef HAVE_TRUNC
return
trunc
(
x
);
#else
return
(
x
>
0
)
?
floor
(
x
)
:
ceil
(
x
);
#endif
}
/*********************************************************************
* truncf (MSVCR120.@)
*/
float
CDECL
MSVCR120_truncf
(
float
x
)
{
#ifdef HAVE_TRUNCF
return
truncf
(
x
);
#else
return
MSVCR120_trunc
(
x
);
#endif
}
/*********************************************************************
* truncl (MSVCR120.@)
*/
LDOUBLE
CDECL
MSVCR120_truncl
(
LDOUBLE
x
)
{
return
MSVCR120_trunc
(
x
);
}
include/config.h.in
View file @
547ba7a1
...
...
@@ -56,6 +56,12 @@
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
#undef HAVE_CARBON_CARBON_H
/* Define to 1 if you have the `cbrt' function. */
#undef HAVE_CBRT
/* Define to 1 if you have the `cbrtf' function. */
#undef HAVE_CBRTF
/* Define to 1 if you have the `chsize' function. */
#undef HAVE_CHSIZE
...
...
@@ -105,6 +111,12 @@
/* Define to 1 if you have the `epoll_create' function. */
#undef HAVE_EPOLL_CREATE
/* Define to 1 if you have the `exp2' function. */
#undef HAVE_EXP2
/* Define to 1 if you have the `exp2f' function. */
#undef HAVE_EXP2F
/* Define to 1 if you have the `fallocate' function. */
#undef HAVE_FALLOCATE
...
...
@@ -426,9 +438,39 @@
/* Define to 1 if you have the <linux/videodev.h> header file. */
#undef HAVE_LINUX_VIDEODEV_H
/* Define to 1 if you have the `llrint' function. */
#undef HAVE_LLRINT
/* Define to 1 if you have the `llrintf' function. */
#undef HAVE_LLRINTF
/* Define to 1 if you have the `llround' function. */
#undef HAVE_LLROUND
/* Define to 1 if you have the `llroundf' function. */
#undef HAVE_LLROUNDF
/* Define to 1 if you have the `log2' function. */
#undef HAVE_LOG2
/* Define to 1 if you have the `log2f' function. */
#undef HAVE_LOG2F
/* Define to 1 if the system has the type `long long'. */
#undef HAVE_LONG_LONG
/* Define to 1 if you have the `lrint' function. */
#undef HAVE_LRINT
/* Define to 1 if you have the `lrintf' function. */
#undef HAVE_LRINTF
/* Define to 1 if you have the `lround' function. */
#undef HAVE_LROUND
/* Define to 1 if you have the `lroundf' function. */
#undef HAVE_LROUNDF
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT
...
...
@@ -663,6 +705,18 @@
/* Define to 1 if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H
/* Define to 1 if you have the `rint' function. */
#undef HAVE_RINT
/* Define to 1 if you have the `rintf' function. */
#undef HAVE_RINTF
/* Define to 1 if you have the `round' function. */
#undef HAVE_ROUND
/* Define to 1 if you have the `roundf' function. */
#undef HAVE_ROUNDF
/* Define to 1 if you have the <sched.h> header file. */
#undef HAVE_SCHED_H
...
...
@@ -1083,6 +1137,12 @@
/* Define if you have the timezone variable */
#undef HAVE_TIMEZONE
/* Define to 1 if you have the `trunc' function. */
#undef HAVE_TRUNC
/* Define to 1 if you have the `truncf' function. */
#undef HAVE_TRUNCF
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment