-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbik_version.cpp
More file actions
34 lines (28 loc) · 785 Bytes
/
bik_version.cpp
File metadata and controls
34 lines (28 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "bik_version.hpp"
#include <stdio.h>
//////////////////////////////////////////////////////////////////////////
Char* makeVersionString(Int32u major, Int32u minor, Int32u micro)
{
static Char buffer[16]; // should be enough, format is "0.0a".
sprintf(buffer, "%d.%d%c", major, minor, ('a' + micro));
return buffer;
}
Int32u makeVersionInt(Int32u major, Int32u minor, Int32u micro)
{
return BIKMOD_MAKE_VERSION_INT(major, minor, micro);
}
Void stringToVersion(Char* string, Int32u& major, Int32u& minor, Int32u& micro)
{
if ((string == NULL) || (*string == '\0'))
{
major = 0;
minor = 0;
micro = 0;
}
else
{
major = BIKMOD_EXTRACT_VERSION_MAJOR(string);
minor = BIKMOD_EXTRACT_VERSION_MINOR(string);
micro = BIKMOD_EXTRACT_VERSION_MICRO(string);
}
}