Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/paths.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@fb.com>2014-10-27 18:30:31 +0300
committerSoumith Chintala <soumith@fb.com>2014-10-27 18:30:31 +0300
commit5ca8bbe02ace0970c346938157614e8eec7c1b19 (patch)
tree14beaf50732b3bda9637a610ce0d6cb91b6e8b52
parent4aebd7d7ca4d4146a4809b5c8cae818a93f08a60 (diff)
adding lua52 compatibility
-rw-r--r--paths.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/paths.c b/paths.c
index 6111cfa..876af06 100644
--- a/paths.c
+++ b/paths.c
@@ -985,6 +985,10 @@ static int readable (const char *filename)
return 1;
}
+#ifndef LUA_PATHSEP /* LUA52 compatibility defs */
+#define LUA_PATHSEP ';'
+#define PATHS_LUA_CLEANUP_DEFS 1
+#endif
static const char *pushnexttemplate (lua_State *L, const char *path)
{
const char *l;
@@ -995,6 +999,9 @@ static const char *pushnexttemplate (lua_State *L, const char *path)
lua_pushlstring(L, path, l - path); /* template */
return l;
}
+#ifdef PATHS_LUA_CLEANUP_DEFS /* cleanup after yourself */
+#undef LUA_PATHSEP
+#endif
static const char *pushfilename (lua_State *L, const char *name)
{