mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-20 02:10:06 +01:00
Add wlr_version_get_{major,minor,micro}()
Can be used to detect wlroots version at runtime rather than compile-time.
This commit is contained in:
parent
0e9c6ddefa
commit
ba931024a5
3 changed files with 19 additions and 0 deletions
|
|
@ -9,4 +9,9 @@
|
|||
|
||||
#define WLR_VERSION_NUM ((WLR_VERSION_MAJOR << 16) | (WLR_VERSION_MINOR << 8) | WLR_VERSION_MICRO)
|
||||
|
||||
/* For runtime version detection */
|
||||
int wlr_version_get_major(void);
|
||||
int wlr_version_get_minor(void);
|
||||
int wlr_version_get_micro(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@ wlr_files += files(
|
|||
'token.c',
|
||||
'transform.c',
|
||||
'utf8.c',
|
||||
'version.c',
|
||||
)
|
||||
|
|
|
|||
13
util/version.c
Normal file
13
util/version.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include "wlr/version.h"
|
||||
|
||||
int wlr_version_get_major(void) {
|
||||
return WLR_VERSION_MAJOR;
|
||||
}
|
||||
|
||||
int wlr_version_get_minor(void) {
|
||||
return WLR_VERSION_MINOR;
|
||||
}
|
||||
|
||||
int wlr_version_get_micro(void) {
|
||||
return WLR_VERSION_MICRO;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue