Skip to content

Commit 80efb07

Browse files
author
Mike Pall
committed
DynASM: Emit version check after .arch directive.
1 parent 416abff commit 80efb07

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dynasm/dynasm.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,9 @@ map_op[".arch_1"] = function(params)
695695
if not params then return "name" end
696696
local err = loadarch(params[1])
697697
if err then wfatal(err) end
698+
wline(format("#if DASM_VERSION != %d", _info.vernum))
699+
wline('#error "Version mismatch between DynASM and included encoding engine"')
700+
wline("#endif")
698701
end
699702

700703
-- Dummy .arch pseudo-opcode to improve the error report.
@@ -877,13 +880,9 @@ local function dasmhead(out)
877880
** DO NOT EDIT! The original file is in "%s".
878881
*/
879882
880-
#if DASM_VERSION != %d
881-
#error "Version mismatch between DynASM and included encoding engine"
882-
#endif
883-
884883
]], _info.url,
885884
_info.version, g_arch._info.arch, g_arch._info.version,
886-
g_fname, _info.vernum))
885+
g_fname))
887886
end
888887

889888
-- Read input file.

0 commit comments

Comments
 (0)