Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9b8afa0f
Commit
9b8afa0f
authored
May 17, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move the Wine version functions to the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2424742d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
22 deletions
+68
-22
Makefile.in
dlls/ntdll/Makefile.in
+8
-0
misc.c
dlls/ntdll/misc.c
+3
-21
loader.c
dlls/ntdll/unix/loader.c
+48
-0
unixlib.h
dlls/ntdll/unixlib.h
+5
-0
makedep.c
tools/makedep.c
+4
-1
No files found.
dlls/ntdll/Makefile.in
View file @
9b8afa0f
...
...
@@ -59,9 +59,17 @@ C_SRCS = \
RC_SRCS
=
version.rc
EXTRA_OBJS
=
unix/version.o
server_EXTRADEFS
=
\
-DBINDIR
=
\"
${
bindir
}
\"
\
-DDLLDIR
=
\"
${
dlldir
}
\"
\
-DBIN_TO_DLLDIR
=
\"
`
$(MAKEDEP)
-R
${
bindir
}
${
dlldir
}
`
\"
\
-DDLL_TO_BINDIR
=
\"
`
$(MAKEDEP)
-R
${
dlldir
}
${
bindir
}
`
\"
\
-DBIN_TO_DATADIR
=
\"
`
$(MAKEDEP)
-R
${
bindir
}
${
datadir
}
/wine
`
\"
unix/version.c
:
dummy
version
=
`
(
GIT_DIR
=
$(top_srcdir)
/.git git describe HEAD 2>/dev/null
||
echo
"wine-
$(PACKAGE_VERSION)
"
)
|
sed
-n
-e
'$$s/\(.*\)/const char wine_build[] = "\1";/p'
`
&&
(
echo
$$
version | cmp
-s
-
$@
)
||
echo
$$
version
>
$@
||
(
rm
-f
$@
&&
exit
1
)
dummy
:
.PHONY
:
dummy
dlls/ntdll/misc.c
View file @
9b8afa0f
...
...
@@ -23,13 +23,9 @@
#include <time.h>
#include <math.h>
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "wine/library.h"
#include "wine/debug.h"
#include "ntdll_misc.h"
#include "wmistr.h"
...
...
@@ -57,7 +53,7 @@ LPCSTR debugstr_us( const UNICODE_STRING *us )
*/
const
char
*
CDECL
NTDLL_wine_get_version
(
void
)
{
return
wine_
get_version
();
return
unix_funcs
->
get_version
();
}
/*********************************************************************
...
...
@@ -65,7 +61,7 @@ const char * CDECL NTDLL_wine_get_version(void)
*/
const
char
*
CDECL
NTDLL_wine_get_build_id
(
void
)
{
return
wine_
get_build_id
();
return
unix_funcs
->
get_build_id
();
}
/*********************************************************************
...
...
@@ -73,21 +69,7 @@ const char * CDECL NTDLL_wine_get_build_id(void)
*/
void
CDECL
NTDLL_wine_get_host_version
(
const
char
**
sysname
,
const
char
**
release
)
{
#ifdef HAVE_SYS_UTSNAME_H
static
struct
utsname
buf
;
static
BOOL
init_done
;
if
(
!
init_done
)
{
uname
(
&
buf
);
init_done
=
TRUE
;
}
if
(
sysname
)
*
sysname
=
buf
.
sysname
;
if
(
release
)
*
release
=
buf
.
release
;
#else
if
(
sysname
)
*
sysname
=
""
;
if
(
release
)
*
release
=
""
;
#endif
return
unix_funcs
->
get_host_version
(
sysname
,
release
);
}
/*********************************************************************
...
...
dlls/ntdll/unix/loader.c
View file @
9b8afa0f
...
...
@@ -31,6 +31,9 @@
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
#ifdef __APPLE__
# include <CoreFoundation/CoreFoundation.h>
# define LoadResource MacLoadResource
...
...
@@ -101,6 +104,48 @@ static void fixup_so_resources( IMAGE_RESOURCE_DIRECTORY *dir, BYTE *root, int d
}
/*********************************************************************
* get_version
*/
const
char
*
CDECL
get_version
(
void
)
{
return
PACKAGE_VERSION
;
}
/*********************************************************************
* get_build_id
*/
const
char
*
CDECL
get_build_id
(
void
)
{
extern
const
char
wine_build
[];
return
wine_build
;
}
/*********************************************************************
* get_host_version
*/
void
CDECL
get_host_version
(
const
char
**
sysname
,
const
char
**
release
)
{
#ifdef HAVE_SYS_UTSNAME_H
static
struct
utsname
buf
;
static
BOOL
init_done
;
if
(
!
init_done
)
{
uname
(
&
buf
);
init_done
=
TRUE
;
}
if
(
sysname
)
*
sysname
=
buf
.
sysname
;
if
(
release
)
*
release
=
buf
.
release
;
#else
if
(
sysname
)
*
sysname
=
""
;
if
(
release
)
*
release
=
""
;
#endif
}
/*************************************************************************
* map_so_dll
*
...
...
@@ -379,6 +424,9 @@ static HMODULE load_ntdll(void)
*/
static
struct
unix_funcs
unix_funcs
=
{
get_version
,
get_build_id
,
get_host_version
,
map_so_dll
,
mmap_add_reserved_area
,
mmap_remove_reserved_area
,
...
...
dlls/ntdll/unixlib.h
View file @
9b8afa0f
...
...
@@ -28,6 +28,11 @@
struct
unix_funcs
{
/* environment functions */
const
char
*
(
CDECL
*
get_version
)(
void
);
const
char
*
(
CDECL
*
get_build_id
)(
void
);
void
(
CDECL
*
get_host_version
)(
const
char
**
sysname
,
const
char
**
release
);
/* virtual memory functions */
NTSTATUS
(
CDECL
*
map_so_dll
)(
const
IMAGE_NT_HEADERS
*
nt_descr
,
HMODULE
module
);
void
(
CDECL
*
mmap_add_reserved_area
)(
void
*
addr
,
SIZE_T
size
);
...
...
tools/makedep.c
View file @
9b8afa0f
...
...
@@ -1969,7 +1969,10 @@ static void add_generated_sources( struct makefile *make )
{
/* default to .c for unknown extra object files */
if
(
strendswith
(
objs
.
str
[
i
],
".o"
))
add_generated_source
(
make
,
objs
.
str
[
i
],
replace_extension
(
objs
.
str
[
i
],
".o"
,
".c"
));
{
file
=
add_generated_source
(
make
,
objs
.
str
[
i
],
replace_extension
(
objs
.
str
[
i
],
".o"
,
".c"
));
if
(
make
->
module
||
make
->
staticlib
)
file
->
file
->
flags
|=
FLAG_C_UNIX
;
}
else
if
(
strendswith
(
objs
.
str
[
i
],
".res"
))
add_generated_source
(
make
,
replace_extension
(
objs
.
str
[
i
],
".res"
,
".rc"
),
NULL
);
else
...
...
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