From 61a4e64a6667bedaa882571c48a173ef5a4ba73b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 6 May 2020 14:19:08 -0300 Subject: Back to old encoding of versions in binary files (Undoing part of commit f53eabeed8.) It is better to keep this encoding stable, so that all Lua versions can read at least the version of a binary file. --- lundump.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lundump.h') diff --git a/lundump.h b/lundump.h index 5b05fed4..2df6923e 100644 --- a/lundump.h +++ b/lundump.h @@ -18,7 +18,12 @@ #define LUAC_INT 0x5678 #define LUAC_NUM cast_num(370.5) -#define LUAC_VERSION LUA_VERSION_NUM +/* +** Encode major-minor version in one byte, one nibble for each +*/ +#define MYINT(s) (s[0]-'0') /* assume one-digit numbers */ +#define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) + #define LUAC_FORMAT 0 /* this is the official format */ /* load one chunk; from lundump.c */ -- cgit v1.2.3-55-g6feb