diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-05-06 14:19:08 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-05-06 14:19:08 -0300 |
commit | 61a4e64a6667bedaa882571c48a173ef5a4ba73b (patch) | |
tree | a68bc1aef4dded2da5f4b0bd8c084075c18ae355 /lundump.h | |
parent | 9a6f47f0edfded799f7cb6fd719bb0071b326100 (diff) | |
download | lua-61a4e64a6667bedaa882571c48a173ef5a4ba73b.tar.gz lua-61a4e64a6667bedaa882571c48a173ef5a4ba73b.tar.bz2 lua-61a4e64a6667bedaa882571c48a173ef5a4ba73b.zip |
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.
Diffstat (limited to 'lundump.h')
-rw-r--r-- | lundump.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -18,7 +18,12 @@ | |||
18 | #define LUAC_INT 0x5678 | 18 | #define LUAC_INT 0x5678 |
19 | #define LUAC_NUM cast_num(370.5) | 19 | #define LUAC_NUM cast_num(370.5) |
20 | 20 | ||
21 | #define LUAC_VERSION LUA_VERSION_NUM | 21 | /* |
22 | ** Encode major-minor version in one byte, one nibble for each | ||
23 | */ | ||
24 | #define MYINT(s) (s[0]-'0') /* assume one-digit numbers */ | ||
25 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) | ||
26 | |||
22 | #define LUAC_FORMAT 0 /* this is the official format */ | 27 | #define LUAC_FORMAT 0 /* this is the official format */ |
23 | 28 | ||
24 | /* load one chunk; from lundump.c */ | 29 | /* load one chunk; from lundump.c */ |