summaryrefslogtreecommitdiff
path: root/src/01-coroutine/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/01-coroutine/main.cpp')
-rw-r--r--src/01-coroutine/main.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/01-coroutine/main.cpp b/src/01-coroutine/main.cpp
index 7e711be..8187f6b 100644
--- a/src/01-coroutine/main.cpp
+++ b/src/01-coroutine/main.cpp
@@ -1,8 +1,5 @@
-extern "C" {
-#include "../lua51/lua.h"
-#include "../lua51/lualib.h"
-#include "../lua51/lauxlib.h"
-}
+#include "../configure.h"
+#if BUILD_TEST == TEST_1
#include <windows.h>
#include <time.h>
@@ -48,14 +45,8 @@ luaL_reg fns[] = {
void openlibs(lua_State* L)
{
luaL_openlibs(L);
- //luaL_register(L, NULL, fns);
- luaL_reg* fn;
- int i = 0;
- for (fn = &fns[0]; fn->name != 0; fn = &fns[++i])
- {
- lua_pushcfunction(L, fn->func);
- lua_setglobal(L, fn->name);
- }
+ ///luaL_register(L, NULL, fns);
+ luax_registerglobal(L, fns);
}
int main(int args, char* argv[])
@@ -67,4 +58,6 @@ int main(int args, char* argv[])
lua_close(L);
return 0;
-} \ No newline at end of file
+}
+
+#endif \ No newline at end of file