浏览代码

no need to define 'luaP_opnames' in regular builds

Roberto Ierusalimschy 7 年之前
父节点
当前提交
26eb144541
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 5 1
      lopcodes.c
  2. 5 1
      ltests.h

+ 5 - 1
lopcodes.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lopcodes.c,v 1.80 2018/03/07 15:55:38 roberto Exp roberto $
+** $Id: lopcodes.c,v 1.81 2018/04/04 14:23:41 roberto Exp roberto $
 ** Opcodes for Lua virtual machine
 ** Opcodes for Lua virtual machine
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -17,6 +17,8 @@
 
 
 /* ORDER OP */
 /* ORDER OP */
 
 
+#if defined(LUAI_DEFOPNAMES)
+
 LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
 LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
   "MOVE",
   "MOVE",
   "LOADI",
   "LOADI",
@@ -98,6 +100,8 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
   NULL
   NULL
 };
 };
 
 
+#endif
+
 
 
 LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
 LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
 /*       OT IT T  A  mode		   opcode  */
 /*       OT IT T  A  mode		   opcode  */

+ 5 - 1
ltests.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: ltests.h,v 2.56 2018/02/27 18:47:32 roberto Exp roberto $
+** $Id: ltests.h,v 2.57 2018/04/11 16:49:36 roberto Exp roberto $
 ** Internal Header for Debugging of the Lua Implementation
 ** Internal Header for Debugging of the Lua Implementation
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -24,6 +24,10 @@
 #define lua_assert(c)           assert(c)
 #define lua_assert(c)           assert(c)
 
 
 
 
+/* include opcode names */
+#define LUAI_DEFOPNAMES
+
+
 /* compiled with -O0, Lua uses a lot of C stack space... */
 /* compiled with -O0, Lua uses a lot of C stack space... */
 #undef LUAI_MAXCCALLS
 #undef LUAI_MAXCCALLS
 #define LUAI_MAXCCALLS	200
 #define LUAI_MAXCCALLS	200