From e260b467c42a32f5491f76d642545de247f5f787 Mon Sep 17 00:00:00 2001 From: Joram Vandemoortele Date: Thu, 8 Apr 2021 18:33:22 +0200 Subject: [PATCH] made wren version number accessable via function (#958) --- src/include/wren.h | 5 +++++ src/vm/wren_vm.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/include/wren.h b/src/include/wren.h index ea6e0501..7845911c 100644 --- a/src/include/wren.h +++ b/src/include/wren.h @@ -296,6 +296,11 @@ typedef enum WREN_TYPE_UNKNOWN } WrenType; +// Get the current wren version number. +// +// Can be used to range checks over versions. +WREN_API int wrenGetVersionNumber(); + // Initializes [configuration] with all of its default values. // // Call this before setting the particular fields you care about. diff --git a/src/vm/wren_vm.c b/src/vm/wren_vm.c index 13b7233b..df4d706c 100644 --- a/src/vm/wren_vm.c +++ b/src/vm/wren_vm.c @@ -36,6 +36,11 @@ static void* defaultReallocate(void* ptr, size_t newSize, void* _) return realloc(ptr, newSize); } +int wrenGetVersionNumber() +{ + return WREN_VERSION_NUMBER; +} + void wrenInitConfiguration(WrenConfiguration* config) { config->reallocateFn = defaultReallocate;