forked from kactus2/kactus2dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVersionHelper.cpp
More file actions
51 lines (45 loc) · 1.75 KB
/
VersionHelper.cpp
File metadata and controls
51 lines (45 loc) · 1.75 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//-----------------------------------------------------------------------------
// File: VersionHelper.cpp
//-----------------------------------------------------------------------------
// Project: Kactus2
// Author: Janne Virtanen
// Date: 31.8.2016
//
// Description:
// A module that returns variations of version number as QStrings.
//-----------------------------------------------------------------------------
#include "version.h"
#include "VersionHelper.h"
// Used to convert defined values to string.
// Double stringize is required to expand possible macros in str.
#define DOUBLE_STR(x) #x
#define TOSTRING(str) DOUBLE_STR(str)
//-----------------------------------------------------------------------------
// Function: VersionHelper::createVersionString()
//-----------------------------------------------------------------------------
QString VersionHelper::createVersionString()
{
#if defined (_WIN64) || (__LP64__) || (_LP64)
int bits = 64;
#else
int bits = 32;
#endif
return QString("%1.%2.%3 %4-bit").arg(QString::number(VERSION_MAJOR),
QString::number(VERSION_MINOR),
QString::number(VERSION_BUILDNO),
QString::number(bits));
}
//-----------------------------------------------------------------------------
// Function: VersionHelper::versionFull()
//-----------------------------------------------------------------------------
QString VersionHelper::versionFull()
{
return TOSTRING(VERSION_FULL);
}
//-----------------------------------------------------------------------------
// Function: VersionHelper::versionFileStr()
//-----------------------------------------------------------------------------
QString VersionHelper::versionFileStr()
{
return VERSION_FILESTR;
}