History

Create a header file that can be used to determine the VM version at build time.

arr committed 10 years ago

Commit bcb41351 parent 54574d53 files · +18 −2Browse files

Unified · Split

3 files
  1. src/include/disvm.h +1 −1
  2. src/include/vm_version.h +15 −0
  3. src/vm/vm.cpp +2 −1
src/include/disvm.h+1−1
@@ -52,7 +52,7 @@ namespace disvm · 51 unmodified lines
5252
5353 public:
5454 // Get the VM version.
55− // All fields on the input structure will be set.
55+ // All fields on the output structure will be set.
5656 vm_version_t get_version() const;
5757
5858 // Begin execution of the module at the supplied path
src/include/vm_version.h+15−0
@@ -0,0 +1,15 @@
1+//
2+// Dis VM
3+// File: vm_version.h
4+// Author: arr
5+//
6+
7+#ifndef _DISVM_SRC_INCLUDE_VM_VERSION_H_
8+#define _DISVM_SRC_INCLUDE_VM_VERSION_H_
9+
10+#define DISVM_VERSION_MAJOR 1
11+#define DISVM_VERSION_MINOR 0
12+#define DISVM_VERSION_PATCH 0
13+#define DISVM_VERSION_LABEL "alpha"
14+
15+#endif // _DISVM_SRC_INCLUDE_VM_VERSION_H_
src/vm/vm.cpp+2−1
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <runtime.h>
1313 #include <exceptions.h>
1414 #include <builtin_module.h>
15+#include <vm_version.h>
1516 #include "scheduler.h"
1617 #include "garbage_collector.h"
1718
@@ -82,7 +83,7 @@ vm_t::~vm_t() · 64 unmodified lines
8283
8384 vm_version_t vm_t::get_version() const
8485 {
85− return{ 1, 0, 0, "alpha" };
86+ return{ DISVM_VERSION_MAJOR, DISVM_VERSION_MINOR, DISVM_VERSION_PATCH, DISVM_VERSION_LABEL };
8687 }
8788
8889 namespace