diff options
author | chai <chaifix@163.com> | 2018-10-23 12:23:58 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-23 12:23:58 +0800 |
commit | 40fc27154fe754181934dc7ee31375e6bdfb33fc (patch) | |
tree | 897ad98d759bc308ef66561181ba88b85f2ccd47 /src/main.cpp | |
parent | 1480c9445100075c9e1a894eb07c0ef727b509a1 (diff) |
*merge from minimal
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index 8bd308b..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#ifdef _WIN32 -# include <SDL2/SDL_Main.h> -# include <direct.h> -#endif - -#include "lua/modules/luax.h" -#include "lua/modules/jin.h" -#include "libjin/jin.h" -#include <Windows.h> - -using namespace jin::lua; - -int main(int argc, char* argv[]) -{ - lua_State* L = luax_newstate(); - - luax_openlibs(L); - luaopen_jin(L); - - // add args to global field - luax_newtable(L); - for (int i = 0; i < argc; ++i) - luax_setraw_string(L, -2, i + 1, argv[i]); - luax_setfield(L, -2, "_argv"); - - const int BUFFER_SIZE = 512; - char buffer[BUFFER_SIZE]; -#ifdef _WIN32 - _getcwd(buffer, BUFFER_SIZE); -#elif defined __unix__ -#elif defined __APPLE__ -#endif - luax_setfield_string(L, "_dir", buffer); - boot(L); - luax_close(L); - - return 0; -}
\ No newline at end of file |