diff options
| author | mascarenhas <mascarenhas> | 2008-03-25 18:20:29 +0000 |
|---|---|---|
| committer | mascarenhas <mascarenhas> | 2008-03-25 18:20:29 +0000 |
| commit | baf658a7218e0ec6f400b461819a21f81dcdd518 (patch) | |
| tree | e01b21bf048f95e7c0e5acf4e2f827e849f108aa | |
| parent | 5c8e92efa35f241d346dd839658c7d52bd699c8e (diff) | |
| download | luafilesystem-baf658a7218e0ec6f400b461819a21f81dcdd518.tar.gz luafilesystem-baf658a7218e0ec6f400b461819a21f81dcdd518.tar.bz2 luafilesystem-baf658a7218e0ec6f400b461819a21f81dcdd518.zip | |
large file support in Linux needs STAT64=-DHAVE_STAT64 in LuaRocks
config
| -rw-r--r-- | rockspecs/luafilesystem-cvs-2.rockspec | 2 | ||||
| -rw-r--r-- | src/lfs.c | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/rockspecs/luafilesystem-cvs-2.rockspec b/rockspecs/luafilesystem-cvs-2.rockspec index 45e7b38..1320390 100644 --- a/rockspecs/luafilesystem-cvs-2.rockspec +++ b/rockspecs/luafilesystem-cvs-2.rockspec | |||
| @@ -22,7 +22,7 @@ build = { | |||
| 22 | type = "make", | 22 | type = "make", |
| 23 | build_variables = { | 23 | build_variables = { |
| 24 | LIB_OPTION = "$(LIBFLAG)", | 24 | LIB_OPTION = "$(LIBFLAG)", |
| 25 | CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR)", | 25 | CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR) $(STAT64)", |
| 26 | }, | 26 | }, |
| 27 | install_variables = { | 27 | install_variables = { |
| 28 | LUA_LIBDIR = "$(LIBDIR)" | 28 | LUA_LIBDIR = "$(LIBDIR)" |
| @@ -16,7 +16,7 @@ | |||
| 16 | ** lfs.touch (filepath [, atime [, mtime]]) | 16 | ** lfs.touch (filepath [, atime [, mtime]]) |
| 17 | ** lfs.unlock (fh) | 17 | ** lfs.unlock (fh) |
| 18 | ** | 18 | ** |
| 19 | ** $Id: lfs.c,v 1.50 2008/03/25 16:58:29 mascarenhas Exp $ | 19 | ** $Id: lfs.c,v 1.51 2008/03/25 18:20:29 mascarenhas Exp $ |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #define _LARGEFILE64_SOURCE | 22 | #define _LARGEFILE64_SOURCE |
| @@ -82,8 +82,15 @@ typedef struct dir_data { | |||
| 82 | #define _O_BINARY 0 | 82 | #define _O_BINARY 0 |
| 83 | #define lfs_setmode(L,file,m) ((void)((void)file,m), \ | 83 | #define lfs_setmode(L,file,m) ((void)((void)file,m), \ |
| 84 | luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1) | 84 | luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1) |
| 85 | #ifdef HAVE_STAT64 | ||
| 85 | #define STAT_STRUCT struct stat64 | 86 | #define STAT_STRUCT struct stat64 |
| 86 | #define STAT_FUNC stat64 | 87 | #define STAT_FUNC stat64 |
| 88 | #define LSTAT_FUNC lstat64 | ||
| 89 | #else | ||
| 90 | #define STAT_STRUCT struct stat | ||
| 91 | #define STAT_FUNC stat | ||
| 92 | #define LSTAT_FUNC lstat | ||
| 93 | #endif | ||
| 87 | #endif | 94 | #endif |
| 88 | 95 | ||
| 89 | /* | 96 | /* |
| @@ -627,7 +634,7 @@ static int file_info (lua_State *L) { | |||
| 627 | */ | 634 | */ |
| 628 | #ifndef _WIN32 | 635 | #ifndef _WIN32 |
| 629 | static int link_info (lua_State *L) { | 636 | static int link_info (lua_State *L) { |
| 630 | return _file_info_ (L, lstat64); | 637 | return _file_info_ (L, LSTAT_FUNC); |
| 631 | } | 638 | } |
| 632 | #else | 639 | #else |
| 633 | static int link_info (lua_State *L) { | 640 | static int link_info (lua_State *L) { |
