diff --git a/src/lfs.c b/src/lfs.c index bbf1ba3..bb10e73 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -16,7 +16,7 @@ ** lfs.touch (filepath [, atime [, mtime]]) ** lfs.unlock (fh) ** -** $Id: lfs.c,v 1.54 2008/07/31 19:34:22 carregal Exp $ +** $Id: lfs.c,v 1.55 2008/12/15 16:13:55 mascarenhas Exp $ */ #ifndef _WIN32 @@ -27,6 +27,8 @@ #endif #endif +#define _LARGEFILE64_SOURCE + #include #include #include @@ -38,7 +40,11 @@ #include #include #include -#include +#ifdef __BORLANDC__ + #include +#else + #include +#endif #include #else #include @@ -80,8 +86,13 @@ typedef struct dir_data { #ifdef _WIN32 -#define lfs_setmode(L,file,m) ((void)L, _setmode(_fileno(file), m)) -#define STAT_STRUCT struct _stati64 + #ifdef __BORLANDC__ + #define lfs_setmode(L,file,m) ((void)L, setmode(_fileno(file), m)) + #define STAT_STRUCT struct stati64 + #else + #define lfs_setmode(L,file,m) ((void)L, _setmode(_fileno(file), m)) + #define STAT_STRUCT struct _stati64 + #endif #define STAT_FUNC _stati64 #else #define _O_TEXT 0 @@ -173,7 +184,11 @@ static int _file_lock (lua_State *L, FILE *fh, const char *mode, const long star len = ftell (fh); } fseek (fh, start, SEEK_SET); +#ifdef __BORLANDC__ + code = locking (fileno(fh), lkmode, len); +#else code = _locking (fileno(fh), lkmode, len); +#endif #else struct flock f; switch (*mode) {