Last active
December 12, 2015 09:39
-
-
Save altexy/4753458 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <lua.h> | |
#include <lauxlib.h> | |
#define __USE_GNU | |
#include <dlfcn.h> | |
LUALIB_API int luaopen_my_module_core (lua_State *L) | |
{ | |
/* TODO - Windows version, DllMain, then GetModuleFileName */ | |
Dl_info dl_info; | |
dladdr((void *)luaopen_my_module_core, &dl_info); | |
lua_pushstring(L, dl_info.dli_fname); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment