Update Lua config and patch checkdp

develop
Vitaly Pronkin 2016-07-26 23:29:26 -04:00 committed by lethosor
parent e2c6350978
commit 4dd411e862
3 changed files with 20 additions and 20 deletions

@ -80,6 +80,7 @@ src/ltable.c
src/ltablib.c src/ltablib.c
src/ltm.c src/ltm.c
src/lundump.c src/lundump.c
src/lutf8lib.c
src/lvm.c src/lvm.c
src/lzio.c src/lzio.c
) )

@ -11,6 +11,9 @@
#include <limits.h> #include <limits.h>
#include <stddef.h> #include <stddef.h>
#define LUA_USE_LONGJMP //TODO: this is bad
#define LUA_COMPAT_APIINTCASTS
#define LUA_COMPAT_IPAIRS
/* /*
** =================================================================== ** ===================================================================
@ -167,38 +170,30 @@
** hierarchy or if you want to install your libraries in ** hierarchy or if you want to install your libraries in
** non-conventional directories. ** non-conventional directories.
*/ */
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#if defined(_WIN32) /* { */ #if defined(_WIN32) /* { */
/* /*
** In Windows, any exclamation mark ('!') in the path is replaced by the ** In Windows, any exclamation mark ('!') in the path is replaced by the
** path of the directory of the executable file of the current process. ** path of the directory of the executable file of the current process.
*/ */
#define LUA_LDIR "!\\lua\\" #define LUA_LDIR "!\\hack\\lua\\"
#define LUA_CDIR "!\\" #define LUA_CDIR "!\\"
#define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\"
#define LUA_PATH_DEFAULT \ #define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" ".\\?.lua"
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \
LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \
".\\?.lua;" ".\\?\\init.lua"
#define LUA_CPATH_DEFAULT \ #define LUA_CPATH_DEFAULT \
LUA_CDIR"?.dll;" \ LUA_CDIR"?.dll;" ".\\?.dll"
LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \
LUA_CDIR"loadall.dll;" ".\\?.dll"
#else /* }{ */ #else /* }{ */
#define LUA_ROOT "/usr/local/" #define LUA_LDIR "./hack/lua/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" #define LUA_CDIR "./hack/"
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
#define LUA_PATH_DEFAULT \ #define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" "./?.lua"
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
"./?.lua;" "./?/init.lua"
#define LUA_CPATH_DEFAULT \ #define LUA_CPATH_DEFAULT \
LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" LUA_CDIR"?.so;" "./?.so"
#endif /* } */ #endif /* } */
#define LUA_PATH "DFHACK_LUA_PATH"
#define LUA_CPATH "DFHACK_LUA_CPATH"
/* /*
@@ LUA_DIRSEP is the directory separator (for submodules). @@ LUA_DIRSEP is the directory separator (for submodules).
@ -231,11 +226,15 @@
*/ */
#if defined(LUA_BUILD_AS_DLL) /* { */ #if defined(LUA_BUILD_AS_DLL) /* { */
#if defined(_MSC_VER)
#if defined(LUA_CORE) || defined(LUA_LIB) /* { */ #if defined(LUA_CORE) || defined(LUA_LIB) /* { */
#define LUA_API __declspec(dllexport) #define LUA_API __declspec(dllexport)
#else /* }{ */ #else /* }{ */
#define LUA_API __declspec(dllimport) #define LUA_API __declspec(dllimport)
#endif /* } */ #endif /* } */
#else
#define LUA_API __attribute__ ((visibility("default")))
#endif
#else /* }{ */ #else /* }{ */

@ -933,7 +933,7 @@ static void addquoted (luaL_Buffer *b, const char *s, size_t len) {
static void checkdp (char *buff, int nb) { static void checkdp (char *buff, int nb) {
if (memchr(buff, '.', nb) == NULL) { /* no dot? */ if (memchr(buff, '.', nb) == NULL) { /* no dot? */
char point = lua_getlocaledecpoint(); /* try locale point */ char point = lua_getlocaledecpoint(); /* try locale point */
char *ppoint = memchr(buff, point, nb); char *ppoint = (char*)memchr(buff, point, nb);
if (ppoint) *ppoint = '.'; /* change it to a dot */ if (ppoint) *ppoint = '.'; /* change it to a dot */
} }
} }