Mayhaps I overengineered versioning
Some checks failed
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=OFF (push) Successful in 14s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=OFF (push) Successful in 11s
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=ON (push) Failing after 11s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=ON (push) Failing after 13s
CMake / ubuntu-latest - shared=OFF, pthread=ON, posix=ON (push) Failing after 16s
CMake / ubuntu-latest - shared=ON, pthread=ON, posix=ON (push) Failing after 13s

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-08-01 03:01:13 +03:00
parent e8f34b341e
commit 92eefe800b
3 changed files with 7 additions and 20 deletions

View File

@@ -53,12 +53,10 @@ typedef enum dcfg_ValueKind {
dcfg_ValueType_FunctionCall,
} dcfg_ValueType;
typedef struct dcfg_Version {
int major;
int minor;
int patch;
char const *str;
} dcfg_Version;
typedef uint64_t dcfg_Version;
#define DCFG_GET_MAJOR(v) (((v) >> 48) & 0xFFFF)
#define DCFG_GET_MINOR(v) (((v) >> 32) & 0xFFFF)
#define DCFG_GET_PATCH(v) ((v) & 0xFFFFFFFF)
dcfg_Version dcfg_get_version(void);

View File

@@ -249,12 +249,9 @@ long ftell_(void *f) { return ftell(f); }
dcfg_Version dcfg_get_version(void)
{
return (dcfg_Version) {
.major = VERSION_MAJOR,
.minor = VERSION_MINOR,
.patch = VERSION_PATCH,
.str = VERSION_STRING,
};
return (((uint64_t)VERSION_MAJOR & 0xFFFFULL) << 48)
| (((uint64_t)VERSION_MINOR & 0xFFFFULL) << 32)
| ((uint64_t)VERSION_PATCH & 0xFFFFFFFFULL);
}
dcfg_Instance *dcfg_make_instance(dcfg_InstanceCreateInfo const *create_info)

View File

@@ -5,12 +5,4 @@
#define VERSION_MINOR 1
#define VERSION_PATCH 0
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
// proper version string
#define VERSION_STRING \
TOSTRING(VERSION_MAJOR) \
"." TOSTRING(VERSION_MINOR) "." TOSTRING(VERSION_PATCH)
#endif // META_H