diff options
author | Kyle Brenneman <kbrenneman@nvidia.com> | 2016-03-30 16:39:13 -0600 |
---|---|---|
committer | Kyle Brenneman <kbrenneman@nvidia.com> | 2016-03-30 17:35:31 -0600 |
commit | c5bcda3b848fe52d6ae6ef25c917431c06d62d27 (patch) | |
tree | 83a2e799a883eef8c4e02c1656b86ff11b39be20 | |
parent | 3402e115881e9215297084d9e07b850d20f4be56 (diff) |
GLX: Fix the version number macros.
Fix the reversed GLX_VENDOR_ABI_GET_MAJOR_VERSION and
GLX_VENDOR_ABI_GET_MINOR_VERSION macros.
Add individual #defines for libglvnd's major and minor version for better
readability.
-rw-r--r-- | include/glvnd/libglxabi.h | 14 | ||||
-rw-r--r-- | tests/GLX_dummy/GLX_dummy.c | 4 |
2 files changed, 13 insertions, 5 deletions
diff --git a/include/glvnd/libglxabi.h b/include/glvnd/libglxabi.h index b664e76..c718c5d 100644 --- a/include/glvnd/libglxabi.h +++ b/include/glvnd/libglxabi.h @@ -99,9 +99,17 @@ extern "C" { * number is incremented when there's a change but existing vendor libraries * will still work. */ -#define GLX_VENDOR_ABI_VERSION ((1 << 16) | 0) -#define GLX_VENDOR_ABI_GET_MAJOR_VERSION(version) ((version) & 0xFFFF) -#define GLX_VENDOR_ABI_GET_MINOR_VERSION(version) ((version) >> 16) +#define GLX_VENDOR_ABI_MAJOR_VERSION ((uint32_t) 1) +#define GLX_VENDOR_ABI_MINOR_VERSION ((uint32_t) 0) +#define GLX_VENDOR_ABI_VERSION ((GLX_VENDOR_ABI_MAJOR_VERSION << 16) | GLX_VENDOR_ABI_MINOR_VERSION) +static inline uint32_t GLX_VENDOR_ABI_GET_MAJOR_VERSION(uint32_t version) +{ + return version >> 16; +} +static inline uint32_t GLX_VENDOR_ABI_GET_MINOR_VERSION(uint32_t version) +{ + return version & 0xFFFF; +} /*! diff --git a/tests/GLX_dummy/GLX_dummy.c b/tests/GLX_dummy/GLX_dummy.c index 29465c9..c11a563 100644 --- a/tests/GLX_dummy/GLX_dummy.c +++ b/tests/GLX_dummy/GLX_dummy.c @@ -672,9 +672,9 @@ PUBLIC Bool __glx_Main(uint32_t version, __GLXapiImports *imports) { if (GLX_VENDOR_ABI_GET_MAJOR_VERSION(version) - == GLX_VENDOR_ABI_GET_MAJOR_VERSION(GLX_VENDOR_ABI_VERSION)) { + == GLX_VENDOR_ABI_MAJOR_VERSION) { if (GLX_VENDOR_ABI_GET_MINOR_VERSION(version) - >= GLX_VENDOR_ABI_GET_MINOR_VERSION(GLX_VENDOR_ABI_VERSION)) { + >= GLX_VENDOR_ABI_MINOR_VERSION) { apiExports = exports; imports->isScreenSupported = dummyCheckSupportsScreen; |