summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-06-06 18:02:15 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:21:20 +0900
commitdec34d6c7bc0849a469ab517ad5f24e9c3ab9e4b (patch)
tree9ff3543cb9abf82e7acaf06c4428d1ca95f3fe81 /include
parent8f0ac27196ff103560222b236584d7e5ccfab99d (diff)
downloadmruby-dec34d6c7bc0849a469ab517ad5f24e9c3ab9e4b.tar.gz
mruby-dec34d6c7bc0849a469ab517ad5f24e9c3ab9e4b.zip
Split `MRB_BINARY_FORMAT` to major and minor.
The minor versions should be upper compatible. So mere opcode, section addition can be done without breaking compiled binary.
Diffstat (limited to 'include')
-rw-r--r--include/mruby/dump.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/mruby/dump.h b/include/mruby/dump.h
index bad27fdf5..b8161e055 100644
--- a/include/mruby/dump.h
+++ b/include/mruby/dump.h
@@ -49,7 +49,12 @@ MRB_API mrb_irep *mrb_read_irep_buf(mrb_state*, const void*, size_t);
/* Rite Binary File header */
#define RITE_BINARY_IDENT "RITE"
-#define RITE_BINARY_FORMAT_VER "0007"
+/* Binary Format Version Major:Minor */
+/* Major: Incompatible to prior versions */
+/* Minor: Upper-compatible to prior versions */
+#define RITE_BINARY_MAJOR_VER "01"
+#define RITE_BINARY_MINOR_VER "00"
+#define RITE_BINARY_FORMAT_VER RITE_BINARY_MAJOR_VER RITE_BINARY_MINOR_VER
#define RITE_COMPILER_NAME "MATZ"
#define RITE_COMPILER_VERSION "0000"
@@ -66,7 +71,8 @@ MRB_API mrb_irep *mrb_read_irep_buf(mrb_state*, const void*, size_t);
/* binary header */
struct rite_binary_header {
uint8_t binary_ident[4]; /* Binary Identifier */
- uint8_t binary_version[4]; /* Binary Format Version */
+ uint8_t major_version[2]; /* Binary Format Major Version */
+ uint8_t minor_version[2]; /* Binary Format Minor Version */
uint8_t binary_crc[2]; /* Binary CRC */
uint8_t binary_size[4]; /* Binary Size */
uint8_t compiler_name[4]; /* Compiler name */