]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
DynASM: Emit version check after .arch directive.
authorMike Pall <mike>
Thu, 6 Mar 2014 16:54:48 +0000 (17:54 +0100)
committerMike Pall <mike>
Thu, 6 Mar 2014 16:54:48 +0000 (17:54 +0100)
dynasm/dynasm.lua

index 2c0970d85c8478ca235f2813de7266529a3df4ec..0ea8697c07c83230c83cb30d8a0548fc2f23d498 100644 (file)
@@ -695,6 +695,9 @@ map_op[".arch_1"] = function(params)
   if not params then return "name" end
   local err = loadarch(params[1])
   if err then wfatal(err) end
+  wline(format("#if DASM_VERSION != %d", _info.vernum))
+  wline('#error "Version mismatch between DynASM and included encoding engine"')
+  wline("#endif")
 end
 
 -- Dummy .arch pseudo-opcode to improve the error report.
@@ -877,13 +880,9 @@ local function dasmhead(out)
 ** DO NOT EDIT! The original file is in "%s".
 */
 
-#if DASM_VERSION != %d
-#error "Version mismatch between DynASM and included encoding engine"
-#endif
-
 ]], _info.url,
     _info.version, g_arch._info.arch, g_arch._info.version,
-    g_fname, _info.vernum))
+    g_fname))
 end
 
 -- Read input file.