Added more run-time version checks
This commit is contained in:
parent
591f583edb
commit
61d1cf3201
|
@ -32,7 +32,7 @@
|
||||||
#define SRSLTE_VERSION_MAJOR @SRSLTE_VERSION_MAJOR@
|
#define SRSLTE_VERSION_MAJOR @SRSLTE_VERSION_MAJOR@
|
||||||
#define SRSLTE_VERSION_MINOR @SRSLTE_VERSION_MINOR@
|
#define SRSLTE_VERSION_MINOR @SRSLTE_VERSION_MINOR@
|
||||||
#define SRSLTE_VERSION_PATCH @SRSLTE_VERSION_PATCH@
|
#define SRSLTE_VERSION_PATCH @SRSLTE_VERSION_PATCH@
|
||||||
#define SRSLTE_VERSION_STRING @SRSLTE_VERSION_STRING@
|
#define SRSLTE_VERSION_STRING "@SRSLTE_VERSION_STRING@"
|
||||||
|
|
||||||
#define SRSLTE_VERSION_ENCODE(major, minor, patch) ( \
|
#define SRSLTE_VERSION_ENCODE(major, minor, patch) ( \
|
||||||
((major) * 10000) \
|
((major) * 10000) \
|
||||||
|
@ -49,8 +49,10 @@
|
||||||
|
|
||||||
#include "srslte/config.h"
|
#include "srslte/config.h"
|
||||||
|
|
||||||
|
SRSLTE_API char* srslte_get_version();
|
||||||
SRSLTE_API int srslte_get_version_major();
|
SRSLTE_API int srslte_get_version_major();
|
||||||
SRSLTE_API int srslte_get_version_minor();
|
SRSLTE_API int srslte_get_version_minor();
|
||||||
SRSLTE_API int srslte_get_version_patch();
|
SRSLTE_API int srslte_get_version_patch();
|
||||||
|
SRSLTE_API int srslte_check_version(int major, int minor, int patch);
|
||||||
|
|
||||||
#endif // VERSION_
|
#endif // VERSION_
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
|
|
||||||
#include "srslte/version.h"
|
#include "srslte/version.h"
|
||||||
|
|
||||||
|
char* srslte_get_version() {
|
||||||
|
return SRSLTE_VERSION_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
int srslte_get_version_major() {
|
int srslte_get_version_major() {
|
||||||
return SRSLTE_VERSION_MAJOR;
|
return SRSLTE_VERSION_MAJOR;
|
||||||
}
|
}
|
||||||
|
@ -35,3 +39,7 @@ int srslte_get_version_minor() {
|
||||||
int srslte_get_version_patch() {
|
int srslte_get_version_patch() {
|
||||||
return SRSLTE_VERSION_PATCH;
|
return SRSLTE_VERSION_PATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int srslte_check_version(int major, int minor, int patch) {
|
||||||
|
return (SRSLTE_VERSION >= SRSLTE_VERSION_ENCODE(major,minor,patch));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue