diff --git a/releasenotes.md b/releasenotes.md index 2b0aab391..979dc9237 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -14,6 +14,7 @@ - Generics using `@generic` rather than module based. - Reduced memory usage for backtraces on Linux. - On win32 utf-8 console output is now enabled by default in compiled programs +- Add `$$VERSION` and `$$PRERELEASE` compile time constants. ### Fixes - Regression with npot vector in struct triggering an assert #2219. diff --git a/src/compiler/compiler.c b/src/compiler/compiler.c index a81f5f649..c880af723 100644 --- a/src/compiler/compiler.c +++ b/src/compiler/compiler.c @@ -1522,6 +1522,9 @@ void compile() setup_int_define("LLVM_VERSION", 0, type_int); #endif + setup_string_define("VERSION", COMPILER_VERSION); + setup_bool_define("PRERELEASE", PRERELEASE); + setup_bool_define("BENCHMARKING", compiler.build.benchmarking); setup_int_define("JMP_BUF_SIZE", jump_buffer_size(), type_int); setup_bool_define("TESTING", compiler.build.testing);