mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-24 12:23:08 +00:00
Compilation bug fix: ISO C90 forbids mixed declarations and code
This commit is contained in:
4
config
4
config
@@ -11,9 +11,9 @@ LIB_OPTION= -shared #for Linux
|
|||||||
LIBNAME= $T.so.$V
|
LIBNAME= $T.so.$V
|
||||||
|
|
||||||
# Compilation directives
|
# Compilation directives
|
||||||
WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings
|
WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
|
||||||
INCS= -I$(LUA_INC)
|
INCS= -I$(LUA_INC)
|
||||||
CFLAGS= $(WARN) $(INCS)
|
CFLAGS= $(WARN) $(INCS)
|
||||||
CC= gcc
|
CC= gcc
|
||||||
|
|
||||||
# $Id: config,v 1.18 2006/12/15 18:04:50 mascarenhas Exp $
|
# $Id: config,v 1.19 2007/05/15 12:58:35 tomas Exp $
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
** lfs.touch (filepath [, atime [, mtime]])
|
** lfs.touch (filepath [, atime [, mtime]])
|
||||||
** lfs.unlock (fh)
|
** lfs.unlock (fh)
|
||||||
**
|
**
|
||||||
** $Id: lfs.c,v 1.36 2007/05/08 19:23:12 carregal Exp $
|
** $Id: lfs.c,v 1.37 2007/05/15 12:58:35 tomas Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -254,6 +254,8 @@ static int remove_dir (lua_State *L) {
|
|||||||
static int dir_iter (lua_State *L) {
|
static int dir_iter (lua_State *L) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
struct _finddata_t c_file;
|
struct _finddata_t c_file;
|
||||||
|
#else
|
||||||
|
struct dirent *entry;
|
||||||
#endif
|
#endif
|
||||||
dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1));
|
dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1));
|
||||||
luaL_argcheck (L, !d->closed, 1, "closed directory");
|
luaL_argcheck (L, !d->closed, 1, "closed directory");
|
||||||
@@ -279,7 +281,6 @@ static int dir_iter (lua_State *L) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
struct dirent *entry;
|
|
||||||
if ((entry = readdir (d->dir)) != NULL) {
|
if ((entry = readdir (d->dir)) != NULL) {
|
||||||
lua_pushstring (L, entry->d_name);
|
lua_pushstring (L, entry->d_name);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user