summaryrefslogtreecommitdiff
path: root/src/01-coroutine
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-09-17 08:30:49 +0800
committerchai <chaifix@163.com>2019-09-17 08:30:49 +0800
commit695f88366e507032a3a9e1eb747cc48610a4cbe1 (patch)
treeb609599d88b0c2133c914c41bbc11e3af026e7c9 /src/01-coroutine
parentea55f90b49fbfb740a9aec66b4c40060542dc444 (diff)
+协程池、枚举、线程测试
Diffstat (limited to 'src/01-coroutine')
-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