aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-02-15 11:31:04 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-02-15 11:31:04 -0200
commit3cc1a84c9387bd3ef128521f65844a975e41e6b0 (patch)
treef59e9b837158e2f4a9dbb3956451b44413fe3b72 /src
parenta86072a7ecbe00922acf4a2ebdb856334fb3e6b9 (diff)
parent25ecbd31dbbd829d8c3b68e3325a45be374784d2 (diff)
downloadluafilesystem-3cc1a84c9387bd3ef128521f65844a975e41e6b0.tar.gz
luafilesystem-3cc1a84c9387bd3ef128521f65844a975e41e6b0.tar.bz2
luafilesystem-3cc1a84c9387bd3ef128521f65844a975e41e6b0.zip
Merge pull request #49 from catharanthus/master
Minor fixes needed to compile LFS as C++
Diffstat (limited to 'src')
-rw-r--r--src/lfs.c4
-rw-r--r--src/lfs.h7
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) {
292 return 1; 292 return 1;
293} 293}
294static int lfs_unlock_dir(lua_State *L) { 294static int lfs_unlock_dir(lua_State *L) {
295 lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE); 295 lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE);
296 if(lock->fd != INVALID_HANDLE_VALUE) { 296 if(lock->fd != INVALID_HANDLE_VALUE) {
297 CloseHandle(lock->fd); 297 CloseHandle(lock->fd);
298 lock->fd=INVALID_HANDLE_VALUE; 298 lock->fd=INVALID_HANDLE_VALUE;
@@ -325,7 +325,7 @@ static int lfs_lock_dir(lua_State *L) {
325 return 1; 325 return 1;
326} 326}
327static int lfs_unlock_dir(lua_State *L) { 327static int lfs_unlock_dir(lua_State *L) {
328 lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE); 328 lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE);
329 if(lock->ln) { 329 if(lock->ln) {
330 unlink(lock->ln); 330 unlink(lock->ln);
331 free(lock->ln); 331 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 @@
21#define fileno(f) (_fileno(f)) 21#define fileno(f) (_fileno(f))
22#endif 22#endif
23 23
24#ifdef __cplusplus
25extern "C" {
26#endif
24 27
25int luaopen_lfs (lua_State *L); 28int luaopen_lfs (lua_State *L);
29
30#ifdef __cplusplus
31}
32#endif