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
e6059191
Commit
e6059191
authored
Jun 26, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move the math functions to the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fe4379eb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
21 deletions
+48
-21
misc.c
dlls/ntdll/misc.c
+11
-19
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-1
loader.c
dlls/ntdll/unix/loader.c
+23
-0
unixlib.h
dlls/ntdll/unixlib.h
+13
-1
No files found.
dlls/ntdll/misc.c
View file @
e6059191
...
@@ -77,15 +77,7 @@ void CDECL NTDLL_wine_get_host_version( const char **sysname, const char **relea
...
@@ -77,15 +77,7 @@ void CDECL NTDLL_wine_get_host_version( const char **sysname, const char **relea
*/
*/
int
CDECL
NTDLL_abs
(
int
i
)
int
CDECL
NTDLL_abs
(
int
i
)
{
{
return
abs
(
i
);
return
i
>=
0
?
i
:
-
i
;
}
/*********************************************************************
* labs (NTDLL.@)
*/
LONG
CDECL
NTDLL_labs
(
LONG
i
)
{
return
labs
(
i
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -93,7 +85,7 @@ LONG CDECL NTDLL_labs( LONG i )
...
@@ -93,7 +85,7 @@ LONG CDECL NTDLL_labs( LONG i )
*/
*/
double
CDECL
NTDLL_atan
(
double
d
)
double
CDECL
NTDLL_atan
(
double
d
)
{
{
return
atan
(
d
);
return
unix_funcs
->
atan
(
d
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -101,7 +93,7 @@ double CDECL NTDLL_atan( double d )
...
@@ -101,7 +93,7 @@ double CDECL NTDLL_atan( double d )
*/
*/
double
CDECL
NTDLL_ceil
(
double
d
)
double
CDECL
NTDLL_ceil
(
double
d
)
{
{
return
ceil
(
d
);
return
unix_funcs
->
ceil
(
d
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -109,7 +101,7 @@ double CDECL NTDLL_ceil( double d )
...
@@ -109,7 +101,7 @@ double CDECL NTDLL_ceil( double d )
*/
*/
double
CDECL
NTDLL_cos
(
double
d
)
double
CDECL
NTDLL_cos
(
double
d
)
{
{
return
cos
(
d
);
return
unix_funcs
->
cos
(
d
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -117,7 +109,7 @@ double CDECL NTDLL_cos( double d )
...
@@ -117,7 +109,7 @@ double CDECL NTDLL_cos( double d )
*/
*/
double
CDECL
NTDLL_fabs
(
double
d
)
double
CDECL
NTDLL_fabs
(
double
d
)
{
{
return
fabs
(
d
);
return
unix_funcs
->
fabs
(
d
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -125,7 +117,7 @@ double CDECL NTDLL_fabs( double d )
...
@@ -125,7 +117,7 @@ double CDECL NTDLL_fabs( double d )
*/
*/
double
CDECL
NTDLL_floor
(
double
d
)
double
CDECL
NTDLL_floor
(
double
d
)
{
{
return
floor
(
d
);
return
unix_funcs
->
floor
(
d
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -133,7 +125,7 @@ double CDECL NTDLL_floor( double d )
...
@@ -133,7 +125,7 @@ double CDECL NTDLL_floor( double d )
*/
*/
double
CDECL
NTDLL_log
(
double
d
)
double
CDECL
NTDLL_log
(
double
d
)
{
{
return
log
(
d
);
return
unix_funcs
->
log
(
d
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -141,7 +133,7 @@ double CDECL NTDLL_log( double d )
...
@@ -141,7 +133,7 @@ double CDECL NTDLL_log( double d )
*/
*/
double
CDECL
NTDLL_pow
(
double
x
,
double
y
)
double
CDECL
NTDLL_pow
(
double
x
,
double
y
)
{
{
return
pow
(
x
,
y
);
return
unix_funcs
->
pow
(
x
,
y
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -149,7 +141,7 @@ double CDECL NTDLL_pow( double x, double y )
...
@@ -149,7 +141,7 @@ double CDECL NTDLL_pow( double x, double y )
*/
*/
double
CDECL
NTDLL_sin
(
double
d
)
double
CDECL
NTDLL_sin
(
double
d
)
{
{
return
sin
(
d
);
return
unix_funcs
->
sin
(
d
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -157,7 +149,7 @@ double CDECL NTDLL_sin( double d )
...
@@ -157,7 +149,7 @@ double CDECL NTDLL_sin( double d )
*/
*/
double
CDECL
NTDLL_sqrt
(
double
d
)
double
CDECL
NTDLL_sqrt
(
double
d
)
{
{
return
sqrt
(
d
);
return
unix_funcs
->
sqrt
(
d
);
}
}
/*********************************************************************
/*********************************************************************
...
@@ -165,7 +157,7 @@ double CDECL NTDLL_sqrt( double d )
...
@@ -165,7 +157,7 @@ double CDECL NTDLL_sqrt( double d )
*/
*/
double
CDECL
NTDLL_tan
(
double
d
)
double
CDECL
NTDLL_tan
(
double
d
)
{
{
return
tan
(
d
);
return
unix_funcs
->
tan
(
d
);
}
}
#if defined(__GNUC__) && defined(__i386__)
#if defined(__GNUC__) && defined(__i386__)
...
...
dlls/ntdll/ntdll.spec
View file @
e6059191
...
@@ -1508,7 +1508,7 @@
...
@@ -1508,7 +1508,7 @@
@ cdecl iswspace(long) NTDLL_iswspace
@ cdecl iswspace(long) NTDLL_iswspace
@ cdecl iswxdigit(long) NTDLL_iswxdigit
@ cdecl iswxdigit(long) NTDLL_iswxdigit
@ cdecl isxdigit(long) NTDLL_isxdigit
@ cdecl isxdigit(long) NTDLL_isxdigit
@ cdecl labs(long) NTDLL_
l
abs
@ cdecl labs(long) NTDLL_abs
@ cdecl log(double) NTDLL_log
@ cdecl log(double) NTDLL_log
@ cdecl mbstowcs(ptr str long) NTDLL_mbstowcs
@ cdecl mbstowcs(ptr str long) NTDLL_mbstowcs
@ cdecl memchr(ptr long long) NTDLL_memchr
@ cdecl memchr(ptr long long) NTDLL_memchr
...
...
dlls/ntdll/unix/loader.c
View file @
e6059191
...
@@ -1331,6 +1331,19 @@ ULONG_PTR get_image_address(void)
...
@@ -1331,6 +1331,19 @@ ULONG_PTR get_image_address(void)
}
}
/* math function wrappers */
static
double
CDECL
ntdll_atan
(
double
d
)
{
return
atan
(
d
);
}
static
double
CDECL
ntdll_ceil
(
double
d
)
{
return
ceil
(
d
);
}
static
double
CDECL
ntdll_cos
(
double
d
)
{
return
cos
(
d
);
}
static
double
CDECL
ntdll_fabs
(
double
d
)
{
return
fabs
(
d
);
}
static
double
CDECL
ntdll_floor
(
double
d
)
{
return
floor
(
d
);
}
static
double
CDECL
ntdll_log
(
double
d
)
{
return
log
(
d
);
}
static
double
CDECL
ntdll_pow
(
double
x
,
double
y
)
{
return
pow
(
x
,
y
);
}
static
double
CDECL
ntdll_sin
(
double
d
)
{
return
sin
(
d
);
}
static
double
CDECL
ntdll_sqrt
(
double
d
)
{
return
sqrt
(
d
);
}
static
double
CDECL
ntdll_tan
(
double
d
)
{
return
tan
(
d
);
}
/***********************************************************************
/***********************************************************************
* unix_funcs
* unix_funcs
*/
*/
...
@@ -1466,6 +1479,16 @@ static struct unix_funcs unix_funcs =
...
@@ -1466,6 +1479,16 @@ static struct unix_funcs unix_funcs =
fast_RtlSleepConditionVariableSRW
,
fast_RtlSleepConditionVariableSRW
,
fast_RtlSleepConditionVariableCS
,
fast_RtlSleepConditionVariableCS
,
fast_RtlWakeConditionVariable
,
fast_RtlWakeConditionVariable
,
ntdll_atan
,
ntdll_ceil
,
ntdll_cos
,
ntdll_fabs
,
ntdll_floor
,
ntdll_log
,
ntdll_pow
,
ntdll_sin
,
ntdll_sqrt
,
ntdll_tan
,
get_initial_environment
,
get_initial_environment
,
get_dynamic_environment
,
get_dynamic_environment
,
get_initial_directory
,
get_initial_directory
,
...
...
dlls/ntdll/unixlib.h
View file @
e6059191
...
@@ -29,7 +29,7 @@ struct msghdr;
...
@@ -29,7 +29,7 @@ struct msghdr;
struct
_DISPATCHER_CONTEXT
;
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 6
3
#define NTDLL_UNIXLIB_VERSION 6
4
struct
unix_funcs
struct
unix_funcs
{
{
...
@@ -285,6 +285,18 @@ struct unix_funcs
...
@@ -285,6 +285,18 @@ struct unix_funcs
const
LARGE_INTEGER
*
timeout
);
const
LARGE_INTEGER
*
timeout
);
NTSTATUS
(
CDECL
*
fast_RtlWakeConditionVariable
)(
RTL_CONDITION_VARIABLE
*
variable
,
int
count
);
NTSTATUS
(
CDECL
*
fast_RtlWakeConditionVariable
)(
RTL_CONDITION_VARIABLE
*
variable
,
int
count
);
/* math functions */
double
(
CDECL
*
atan
)(
double
d
);
double
(
CDECL
*
ceil
)(
double
d
);
double
(
CDECL
*
cos
)(
double
d
);
double
(
CDECL
*
fabs
)(
double
d
);
double
(
CDECL
*
floor
)(
double
d
);
double
(
CDECL
*
log
)(
double
d
);
double
(
CDECL
*
pow
)(
double
x
,
double
y
);
double
(
CDECL
*
sin
)(
double
d
);
double
(
CDECL
*
sqrt
)(
double
d
);
double
(
CDECL
*
tan
)(
double
d
);
/* environment functions */
/* environment functions */
NTSTATUS
(
CDECL
*
get_initial_environment
)(
WCHAR
**
wargv
[],
WCHAR
*
env
,
SIZE_T
*
size
);
NTSTATUS
(
CDECL
*
get_initial_environment
)(
WCHAR
**
wargv
[],
WCHAR
*
env
,
SIZE_T
*
size
);
NTSTATUS
(
CDECL
*
get_dynamic_environment
)(
WCHAR
*
env
,
SIZE_T
*
size
);
NTSTATUS
(
CDECL
*
get_dynamic_environment
)(
WCHAR
*
env
,
SIZE_T
*
size
);
...
...
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