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:
Józef Kucia
2019-06-17 15:43:31 +02:00
committed by Alexandre Julliard
parent 096dfde280
commit f723a791d5
4 changed files with 65 additions and 14 deletions

View File

@@ -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 */