[syslinux:master] lua: share the export macro (CPP only change)

syslinux-bot for Ferenc Wágner wferi at niif.hu
Sat Feb 14 11:09:10 PST 2015


Commit-ID:  8eb0ba9e217943280315af3e745125cfb28341dc
Gitweb:     http://www.syslinux.org/commit/8eb0ba9e217943280315af3e745125cfb28341dc
Author:     Ferenc Wágner <wferi at niif.hu>
AuthorDate: Thu, 3 Jul 2014 15:45:27 +0200
Committer:  Ferenc Wágner <wferi at niif.hu>
CommitDate: Sat, 11 Oct 2014 21:59:15 +0200

lua: share the export macro (CPP only change)

Signed-off-by: Ferenc Wágner <wferi at niif.hu>

---
 com32/lua/src/syslinux.c | 78 ++++++++++++++++++++++++------------------------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/com32/lua/src/syslinux.c b/com32/lua/src/syslinux.c
index f17faf3..fc2effc 100644
--- a/com32/lua/src/syslinux.c
+++ b/com32/lua/src/syslinux.c
@@ -489,49 +489,49 @@ LUALIB_API int luaopen_syslinux(lua_State * L)
 
     luaL_newlib(L, syslinuxlib);
 
+#define export(c,x) lua_pushinteger (L,c##_##x); lua_setfield (L, -2, #x);
+
     lua_newtable (L);
-#define export_key(x) lua_pushinteger (L, KEY_##x); lua_setfield (L, -2, #x);
-    export_key (NONE);
-    export_key (BACKSPACE);
-    export_key (TAB);
-    export_key (ENTER);
-    export_key (ESC);
-    export_key (DEL);
-    export_key (F1);
-    export_key (F2);
-    export_key (F3);
-    export_key (F4);
-    export_key (F5);
-    export_key (F6);
-    export_key (F7);
-    export_key (F8);
-    export_key (F9);
-    export_key (F10);
-    export_key (F11);
-    export_key (F12);
-    export_key (UP);
-    export_key (DOWN);
-    export_key (LEFT);
-    export_key (RIGHT);
-    export_key (PGUP);
-    export_key (PGDN);
-    export_key (HOME);
-    export_key (END);
-    export_key (INSERT);
-    export_key (DELETE);
+    export (KEY, NONE);
+    export (KEY, BACKSPACE);
+    export (KEY, TAB);
+    export (KEY, ENTER);
+    export (KEY, ESC);
+    export (KEY, DEL);
+    export (KEY, F1);
+    export (KEY, F2);
+    export (KEY, F3);
+    export (KEY, F4);
+    export (KEY, F5);
+    export (KEY, F6);
+    export (KEY, F7);
+    export (KEY, F8);
+    export (KEY, F9);
+    export (KEY, F10);
+    export (KEY, F11);
+    export (KEY, F12);
+    export (KEY, UP);
+    export (KEY, DOWN);
+    export (KEY, LEFT);
+    export (KEY, RIGHT);
+    export (KEY, PGUP);
+    export (KEY, PGDN);
+    export (KEY, HOME);
+    export (KEY, END);
+    export (KEY, INSERT);
+    export (KEY, DELETE);
     lua_setfield (L, -2, "KEY");
 
     lua_newtable (L);
-#define export_image_type(x) lua_pushinteger (L, IMAGE_TYPE_##x); lua_setfield (L, -2, #x);
-    export_image_type (KERNEL);
-    export_image_type (LINUX);
-    export_image_type (BOOT);
-    export_image_type (BSS);
-    export_image_type (PXE);
-    export_image_type (FDIMAGE);
-    export_image_type (COM32);
-    export_image_type (CONFIG);
-    export_image_type (LOCALBOOT);
+    export (IMAGE_TYPE, KERNEL);
+    export (IMAGE_TYPE, LINUX);
+    export (IMAGE_TYPE, BOOT);
+    export (IMAGE_TYPE, BSS);
+    export (IMAGE_TYPE, PXE);
+    export (IMAGE_TYPE, FDIMAGE);
+    export (IMAGE_TYPE, COM32);
+    export (IMAGE_TYPE, CONFIG);
+    export (IMAGE_TYPE, LOCALBOOT);
     lua_setfield (L, -2, "IMAGE_TYPE");
 
     return 1;


More information about the Syslinux-commits mailing list