mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
tests: Add test for parsing version.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
096dfde280
commit
f723a791d5
@@ -22,6 +22,8 @@
|
||||
#include "config.h"
|
||||
#include "vkd3d_windows.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
# define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
|
||||
#endif
|
||||
@@ -137,4 +139,16 @@ static inline LONG InterlockedDecrement(LONG volatile *x)
|
||||
# error "atomic_add_fetch() not implemented for this platform"
|
||||
#endif /* HAVE_SYNC_ADD_AND_FETCH */
|
||||
|
||||
static inline void vkd3d_parse_version(const char *version, int *major, int *minor)
|
||||
{
|
||||
*major = atoi(version);
|
||||
|
||||
while (isdigit(*version))
|
||||
++version;
|
||||
if (*version == '.')
|
||||
++version;
|
||||
|
||||
*minor = atoi(version);
|
||||
}
|
||||
|
||||
#endif /* __VKD3D_COMMON_H */
|
||||
|
Reference in New Issue
Block a user