From 25ecbd31dbbd829d8c3b68e3325a45be374784d2 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 15 Feb 2015 08:20:50 +0300 Subject: [PATCH 1/2] A few minor things fixed which prevented compilation of LuaFileSystem as C++ code --- src/lfs.c | 4 ++-- src/lfs.h | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lfs.c b/src/lfs.c index e1da1aa..521d0c5 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -292,7 +292,7 @@ static int lfs_lock_dir(lua_State *L) { return 1; } static int lfs_unlock_dir(lua_State *L) { - lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE); + lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE); if(lock->fd != INVALID_HANDLE_VALUE) { CloseHandle(lock->fd); lock->fd=INVALID_HANDLE_VALUE; @@ -325,7 +325,7 @@ static int lfs_lock_dir(lua_State *L) { return 1; } static int lfs_unlock_dir(lua_State *L) { - lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE); + lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE); if(lock->ln) { unlink(lock->ln); free(lock->ln); diff --git a/src/lfs.h b/src/lfs.h index ddd454d..02ceafb 100644 --- a/src/lfs.h +++ b/src/lfs.h @@ -21,5 +21,12 @@ #define fileno(f) (_fileno(f)) #endif +#ifdef __cplusplus +extern "C" { +#endif int luaopen_lfs (lua_State *L); + +#ifdef __cplusplus +} +#endif From 644c9c32ca9053ced3d37ff76fc1fbc0389ddf53 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 16 Feb 2015 08:15:41 +0300 Subject: [PATCH 2/2] DEF file fixes (DESCRIPTION is deprecated; VERSION must contain one or two numers) --- src/lfs.def | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lfs.def b/src/lfs.def index 7aa7a35..8a36d41 100644 --- a/src/lfs.def +++ b/src/lfs.def @@ -1,5 +1,4 @@ LIBRARY lfs.dll -DESCRIPTION "LuaFileSystem" -VERSION 1.5.0 +VERSION 1.6 EXPORTS luaopen_lfs