Skip to content

Commit

Permalink
Update Lua config and patch checkdp
Browse files Browse the repository at this point in the history
  • Loading branch information
pronvit authored and lethosor committed Jul 27, 2016
1 parent e2c6350 commit 4dd411e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
1 change: 1 addition & 0 deletions depends/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ src/ltable.c
src/ltablib.c
src/ltm.c
src/lundump.c
src/lutf8lib.c
src/lvm.c
src/lzio.c
)
Expand Down
35 changes: 17 additions & 18 deletions depends/lua/include/luaconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include <limits.h>
#include <stddef.h>

#define LUA_USE_LONGJMP //TODO: this is bad
#define LUA_COMPAT_APIINTCASTS
#define LUA_COMPAT_IPAIRS

/*
** ===================================================================
Expand Down Expand Up @@ -167,38 +170,30 @@
** hierarchy or if you want to install your libraries in
** non-conventional directories.
*/
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#if defined(_WIN32) /* { */
/*
** In Windows, any exclamation mark ('!') in the path is replaced by the
** 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_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\"
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \
LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \
".\\?.lua;" ".\\?\\init.lua"
LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" ".\\?.lua"
#define LUA_CPATH_DEFAULT \
LUA_CDIR"?.dll;" \
LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \
LUA_CDIR"loadall.dll;" ".\\?.dll"
LUA_CDIR"?.dll;" ".\\?.dll"

#else /* }{ */

#define LUA_ROOT "/usr/local/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
#define LUA_LDIR "./hack/lua/"
#define LUA_CDIR "./hack/"
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
"./?.lua;" "./?/init.lua"
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" "./?.lua"
#define LUA_CPATH_DEFAULT \
LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
LUA_CDIR"?.so;" "./?.so"
#endif /* } */

#define LUA_PATH "DFHACK_LUA_PATH"
#define LUA_CPATH "DFHACK_LUA_CPATH"

/*
@@ LUA_DIRSEP is the directory separator (for submodules).
Expand Down Expand Up @@ -231,11 +226,15 @@
*/
#if defined(LUA_BUILD_AS_DLL) /* { */

#if defined(_MSC_VER)
#if defined(LUA_CORE) || defined(LUA_LIB) /* { */
#define LUA_API __declspec(dllexport)
#else /* }{ */
#define LUA_API __declspec(dllimport)
#endif /* } */
#else
#define LUA_API __attribute__ ((visibility("default")))
#endif

#else /* }{ */

Expand Down Expand Up @@ -606,7 +605,7 @@


/*
@@ lua_number2strx converts a float to an hexadecimal numeric string.
@@ lua_number2strx converts a float to an hexadecimal numeric string.
** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that.
** Otherwise, you can leave 'lua_number2strx' undefined and Lua will
** provide its own implementation.
Expand Down
4 changes: 2 additions & 2 deletions depends/lua/src/lstrlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ static void addquoted (luaL_Buffer *b, const char *s, size_t len) {
static void checkdp (char *buff, int nb) {
if (memchr(buff, '.', nb) == NULL) { /* no dot? */
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 */
}
}
Expand Down Expand Up @@ -1259,7 +1259,7 @@ static KOption getoption (Header *h, const char **fmt, int *size) {
** 'psize' is filled with option's size, 'notoalign' with its
** alignment requirements.
** Local variable 'size' gets the size to be aligned. (Kpadal option
** always gets its full alignment, other options are limited by
** always gets its full alignment, other options are limited by
** the maximum alignment ('maxalign'). Kchar option needs no alignment
** despite its size.
*/
Expand Down

0 comments on commit 4dd411e

Please sign in to comment.