Commit 22a99191 authored by Niklas Haas's avatar Niklas Haas

config: replace PL_FIX_VER/PL_VERSION by runtime functions

Since the fix version is not part of the ABI, we can't use a header
define for it. (And indeed, users can't use this information as part of
any preprocessor check - nor should they need to)

I won't bother bumping the API version for this change because it's
unlikely to result in any breakage.
parent dc1059b2
Pipeline #7283 passed with stages
in 1 minute and 33 seconds
......@@ -26,10 +26,13 @@
#define PL_API_VER @apiver@
// Increased any time a fix is made to a given API version.
#define PL_FIX_VER @fixver@
#define PL_FIX_VER (pl_fix_ver())
// Friendly name (`git describe`) for the overall version of the library
#define PL_VERSION @version@
#define PL_VERSION (pl_version())
int pl_fix_ver(void);
const char *pl_version(void);
// Feature tests. These aren't described in further detail, but may be useful
// for programmers wanting to programmatically check for feature support
......
......@@ -22,6 +22,16 @@
#include "common.h"
#include "context.h"
int pl_fix_ver()
{
return BUILD_FIX_VER;
}
const char *pl_version()
{
return BUILD_VERSION;
}
static pthread_mutex_t pl_ctx_mutex = PTHREAD_MUTEX_INITIALIZER;
static int pl_ctx_refcount;
......
......@@ -18,8 +18,8 @@ conf_public = configuration_data()
conf_internal = configuration_data()
conf_public.set('majorver', majorver)
conf_public.set('apiver', apiver)
conf_public.set('fixver', fixver)
conf_public.set_quoted('version', version_pretty)
conf_internal.set('BUILD_FIX_VER', fixver)
conf_internal.set_quoted('BUILD_VERSION', version_pretty)
# work-arounds for shaderc braindeath
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment