Merge branch 'mueller/version-getter-upstream' into mueller/master
This commit is contained in:
commit
17262a1da9
@ -1,12 +1,22 @@
|
|||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include "fsfw/FSFWVersion.h"
|
#include "fsfw/FSFWVersion.h"
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
#ifdef major
|
||||||
#undef major
|
#undef major
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef minor
|
||||||
#undef minor
|
#undef minor
|
||||||
|
#endif
|
||||||
|
|
||||||
const fsfw::Version fsfw::FSFW_VERSION = {FSFW_VERSION_MAJOR, FSFW_VERSION_MINOR,
|
const fsfw::Version fsfw::FSFW_VERSION = {FSFW_VERSION_MAJOR, FSFW_VERSION_MINOR,
|
||||||
FSFW_VERSION_REVISION};
|
FSFW_VERSION_REVISION};
|
||||||
|
|
||||||
fsfw::Version::Version(uint32_t major, uint32_t minor, uint32_t revision)
|
fsfw::Version::Version(uint32_t major, uint32_t minor, uint32_t revision)
|
||||||
: major(major), minor(minor), revision(revision) {}
|
: major(major), minor(minor), revision(revision) {}
|
||||||
|
|
||||||
|
void fsfw::Version::getVersion(char* str, size_t maxLen) const {
|
||||||
|
snprintf(str, maxLen, "%d.%d.%d", major, minor, revision);
|
||||||
|
}
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#endif
|
#endif
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
namespace fsfw {
|
namespace fsfw {
|
||||||
|
|
||||||
@ -53,9 +52,7 @@ class Version {
|
|||||||
* @param str
|
* @param str
|
||||||
* @param maxLen
|
* @param maxLen
|
||||||
*/
|
*/
|
||||||
void getVersion(char* str, size_t maxLen) const {
|
void getVersion(char* str, size_t maxLen) const;
|
||||||
snprintf(str, maxLen, "%d.%d.%d", major, minor, revision);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const fsfw::Version FSFW_VERSION;
|
extern const fsfw::Version FSFW_VERSION;
|
||||||
|
Loading…
Reference in New Issue
Block a user