common: Add truncated wide export strcmp.
Needed for GetShaderStackSize(). Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
parent
b41d01d580
commit
13af141e84
|
@ -29,6 +29,7 @@ WCHAR *vkd3d_dup_entry_point_n(const char *str, size_t len);
|
|||
WCHAR *vkd3d_dup_demangled_entry_point(const char *str);
|
||||
|
||||
bool vkd3d_export_strequal(const WCHAR *a, const WCHAR *b);
|
||||
bool vkd3d_export_strequal_substr(const WCHAR *a, size_t n, const WCHAR *b);
|
||||
|
||||
char *vkd3d_strdup(const char *str);
|
||||
WCHAR *vkd3d_wstrdup(const WCHAR *str);
|
||||
|
|
|
@ -63,6 +63,25 @@ bool vkd3d_export_strequal(const WCHAR *a, const WCHAR *b)
|
|||
return *a == *b;
|
||||
}
|
||||
|
||||
bool vkd3d_export_strequal_substr(const WCHAR *a, size_t expected_n, const WCHAR *b)
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
if (!a || !b)
|
||||
return false;
|
||||
|
||||
while (*a != '\0' && *b != '\0' && n < expected_n)
|
||||
{
|
||||
if (*a != *b)
|
||||
return false;
|
||||
a++;
|
||||
b++;
|
||||
n++;
|
||||
}
|
||||
|
||||
return n == expected_n && *b == '\0';
|
||||
}
|
||||
|
||||
WCHAR *vkd3d_dup_entry_point(const char *str)
|
||||
{
|
||||
return vkd3d_dup_entry_point_n(str, strlen(str));
|
||||
|
|
Loading…
Reference in New Issue