summaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-04-11 15:34:06 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-04-11 15:34:06 -0300
commit49c1607157560f0775f3c697cca47b06978cc3e5 (patch)
tree0a92be21e44cc5facaa22b2547127f295ff45ca3 /liolib.c
parentc8e96d6e91dc2e3d5b175cc4cd811398ab35c82d (diff)
downloadlua-github-49c1607157560f0775f3c697cca47b06978cc3e5.tar.gz
_FILE_OFFSET_BITS usually also needs _LARGEFILE_SOURCE + easier to
use default definition for 'l_fseek' in ansi systems
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/liolib.c b/liolib.c
index 6f3bdc50..8f206d32 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,17 +1,17 @@
/*
-** $Id: liolib.c,v 2.110 2013/03/20 19:40:07 roberto Exp roberto $
+** $Id: liolib.c,v 2.111 2013/03/21 13:57:27 roberto Exp roberto $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
/*
-** POSIX idiosyncrasy!
** This definition must come before the inclusion of 'stdio.h'; it
** should not affect non-POSIX systems
*/
#if !defined(_FILE_OFFSET_BITS)
-#define _FILE_OFFSET_BITS 64
+#define _LARGEFILE_SOURCE 1
+#define _FILE_OFFSET_BITS 64
#endif
@@ -80,36 +80,37 @@
/*
** {======================================================
-** lua_fseek/lua_ftell: configuration for longer offsets
+** lua_fseek: configuration for longer offsets
** =======================================================
*/
-#if !defined(lua_fseek) /* { */
+#if !defined(lua_fseek) && !defined(LUA_ANSI) /* { */
-#if defined(LUA_USE_POSIX)
+#if defined(LUA_USE_POSIX) /* { */
#define l_fseek(f,o,w) fseeko(f,o,w)
#define l_ftell(f) ftello(f)
#define l_seeknum off_t
#elif defined(LUA_WIN) && !defined(_CRTIMP_TYPEINFO) \
- && defined(_MSC_VER) && (_MSC_VER >= 1400)
+ && defined(_MSC_VER) && (_MSC_VER >= 1400) /* }{ */
/* Windows (but not DDK) and Visual C++ 2005 or higher */
#define l_fseek(f,o,w) _fseeki64(f,o,w)
#define l_ftell(f) _ftelli64(f)
#define l_seeknum __int64
-#else
+#endif /* } */
+#endif /* } */
+
+
+#if !defined(l_fseek) /* default definitions */
#define l_fseek(f,o,w) fseek(f,o,w)
#define l_ftell(f) ftell(f)
#define l_seeknum long
-
#endif
-#endif /* } */
-
/* }====================================================== */