engine/include/util.h

22 lines
421 B
C
Raw Permalink Normal View History

2023-04-29 14:22:25 +00:00
#ifndef ENGINE_INCLUDE_UTIL_H_
#define ENGINE_INCLUDE_UTIL_H_
2022-10-04 10:54:23 +00:00
#include <cstdio>
namespace engine {
2023-04-29 14:57:32 +00:00
inline bool VersionFromCharArray(const char* version, int* major, int* minor,
2023-04-29 14:22:25 +00:00
int* patch) {
if (sscanf(version, "%d.%d.%d", major, minor, patch) != 3) {
*major = 0;
*minor = 0;
*patch = 0;
return false;
} else {
return true;
}
}
2022-10-04 10:54:23 +00:00
2023-04-29 14:22:25 +00:00
} // namespace engine
#endif