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
4931e6f9
Commit
4931e6f9
authored
Sep 14, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ucrtbase: Add __std_type_info_hash implementation.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
631fd7ff
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
3 deletions
+52
-3
api-ms-win-crt-private-l1-1-0.spec
...win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
+1
-1
cpp.c
dlls/msvcrt/cpp.c
+19
-0
cpp.c
dlls/ucrtbase/tests/cpp.c
+30
-0
ucrtbase.spec
dlls/ucrtbase/ucrtbase.spec
+1
-1
vcruntime140.spec
dlls/vcruntime140/vcruntime140.spec
+1
-1
No files found.
dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
View file @
4931e6f9
...
...
@@ -46,7 +46,7 @@
@ cdecl __std_exception_destroy(ptr) ucrtbase.__std_exception_destroy
@ cdecl __std_type_info_compare(ptr ptr) ucrtbase.__std_type_info_compare
@ cdecl __std_type_info_destroy_list(ptr) ucrtbase.__std_type_info_destroy_list
@
stub
__std_type_info_hash
@
cdecl __std_type_info_hash(ptr) ucrtbase.
__std_type_info_hash
@ cdecl __std_type_info_name(ptr ptr) ucrtbase.__std_type_info_name
@ cdecl __unDName(ptr str long ptr ptr long) ucrtbase.__unDName
@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) ucrtbase.__unDNameEx
...
...
dlls/msvcrt/cpp.c
View file @
4931e6f9
...
...
@@ -1588,4 +1588,23 @@ void CDECL MSVCRT_type_info_destroy_list(SLIST_HEADER *header)
MSVCRT_free
(
cur
);
}
}
/******************************************************************
* __std_type_info_hash (UCRTBASE.@)
*
* TODO: 64-bit version of the function uses different constants
*/
MSVCRT_size_t
CDECL
MSVCRT_type_info_hash
(
const
type_info140
*
ti
)
{
MSVCRT_size_t
hash
=
0x811c9dc5
;
const
char
*
p
;
TRACE
(
"(%p)->%s
\n
"
,
ti
,
ti
->
mangled
);
for
(
p
=
ti
->
mangled
+
1
;
*
p
;
p
++
)
{
hash
^=
*
p
;
hash
*=
0x1000193
;
}
return
hash
;
}
#endif
dlls/ucrtbase/tests/cpp.c
View file @
4931e6f9
...
...
@@ -51,6 +51,7 @@ static void (CDECL *p___std_exception_destroy)(__std_exception_data*);
static
int
(
CDECL
*
p___std_type_info_compare
)(
const
type_info140
*
,
const
type_info140
*
);
static
const
char
*
(
CDECL
*
p___std_type_info_name
)(
type_info140
*
,
SLIST_HEADER
*
);
static
void
(
CDECL
*
p___std_type_info_destroy_list
)(
SLIST_HEADER
*
);
static
size_t
(
CDECL
*
p___std_type_info_hash
)(
type_info140
*
);
static
BOOL
init
(
void
)
...
...
@@ -70,6 +71,7 @@ static BOOL init(void)
p___std_type_info_compare
=
(
void
*
)
GetProcAddress
(
module
,
"__std_type_info_compare"
);
p___std_type_info_name
=
(
void
*
)
GetProcAddress
(
module
,
"__std_type_info_name"
);
p___std_type_info_destroy_list
=
(
void
*
)
GetProcAddress
(
module
,
"__std_type_info_destroy_list"
);
p___std_type_info_hash
=
(
void
*
)
GetProcAddress
(
module
,
"__std_type_info_hash"
);
return
TRUE
;
}
...
...
@@ -125,6 +127,7 @@ static void test___std_type_info(void)
SLIST_HEADER
header
;
type_info_list
*
elem
;
const
char
*
ret
;
size_t
hash1
,
hash2
;
int
eq
;
...
...
@@ -154,6 +157,33 @@ static void test___std_type_info(void)
eq
=
p___std_type_info_compare
(
&
ti1
,
&
ti3
);
ok
(
eq
==
0
,
"__std_type_info_compare(&ti1, &ti3) = %d
\n
"
,
eq
);
ti1
.
mangled
[
0
]
=
0
;
ti1
.
mangled
[
1
]
=
0
;
ti1
.
mangled
[
2
]
=
0
;
hash1
=
p___std_type_info_hash
(
&
ti1
);
#ifdef _WIN64
todo_wine
ok
(
hash1
==
0xcbf29ce44fd0bfc1
,
"hash = %p
\n
"
,
(
void
*
)
hash1
);
#else
ok
(
hash1
==
0x811c9dc5
,
"hash = %p
\n
"
,
(
void
*
)
hash1
);
#endif
ti1
.
mangled
[
0
]
=
1
;
hash2
=
p___std_type_info_hash
(
&
ti1
);
ok
(
hash1
==
hash2
,
"hash1 != hash2 (first char not ignorred)
\n
"
);
ti1
.
mangled
[
1
]
=
1
;
hash1
=
p___std_type_info_hash
(
&
ti1
);
if
(
sizeof
(
void
*
)
==
sizeof
(
int
))
ok
(
hash1
==
0x40c5b8c
,
"hash = %p
\n
"
,
(
void
*
)
hash1
);
ok
(
hash1
!=
hash2
,
"hash1 == hash2 for different strings
\n
"
);
ti1
.
mangled
[
1
]
=
2
;
hash2
=
p___std_type_info_hash
(
&
ti1
);
ok
(
hash1
!=
hash2
,
"hash1 == hash2 for different strings
\n
"
);
hash1
=
p___std_type_info_hash
(
&
ti2
);
ok
(
hash1
!=
hash2
,
"hash1 == hash2 for different strings
\n
"
);
}
START_TEST
(
cpp
)
...
...
dlls/ucrtbase/ucrtbase.spec
View file @
4931e6f9
...
...
@@ -144,7 +144,7 @@
@ cdecl __std_exception_destroy(ptr) MSVCRT___std_exception_destroy
@ cdecl __std_type_info_compare(ptr ptr) MSVCRT_type_info_compare
@ cdecl __std_type_info_destroy_list(ptr) MSVCRT_type_info_destroy_list
@
stub __std
_type_info_hash
@
cdecl __std_type_info_hash(ptr) MSVCRT
_type_info_hash
@ cdecl __std_type_info_name(ptr ptr) MSVCRT_type_info_name_list
@ cdecl __stdio_common_vfprintf(int64 ptr str ptr ptr) MSVCRT__stdio_common_vfprintf
@ stub __stdio_common_vfprintf_p
...
...
dlls/vcruntime140/vcruntime140.spec
View file @
4931e6f9
...
...
@@ -41,7 +41,7 @@
@ stub __std_terminate
@ cdecl __std_type_info_compare(ptr ptr) ucrtbase.__std_type_info_compare
@ cdecl __std_type_info_destroy_list(ptr) ucrtbase.__std_type_info_destroy_list
@
stub
__std_type_info_hash
@
cdecl __std_type_info_hash(ptr) ucrtbase.
__std_type_info_hash
@ cdecl __std_type_info_name(ptr ptr) ucrtbase.__std_type_info_name
@ cdecl __telemetry_main_invoke_trigger(ptr)
@ cdecl __telemetry_main_return_trigger(ptr)
...
...
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