more uniformity for defining system-dependent features
This commit is contained in:
41
liolib.c
41
liolib.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: liolib.c,v 2.115 2014/01/27 13:28:45 roberto Exp roberto $
|
||||
** $Id: liolib.c,v 2.116 2014/02/21 14:39:50 roberto Exp roberto $
|
||||
** Standard I/O (and system) library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -51,29 +51,30 @@
|
||||
** =======================================================
|
||||
*/
|
||||
|
||||
#if !defined(lua_popen) /* { */
|
||||
#if !defined(lua_popen) /* { */
|
||||
|
||||
#if defined(LUA_USE_POPEN) /* { */
|
||||
#if defined(LUA_USE_POSIX) /* { */
|
||||
|
||||
#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m))
|
||||
#define lua_pclose(L,file) ((void)L, pclose(file))
|
||||
#define lua_popen(L,c,m) (fflush(NULL), popen(c,m))
|
||||
#define lua_pclose(L,file) (pclose(file))
|
||||
|
||||
#elif defined(LUA_WIN) /* }{ */
|
||||
|
||||
#define lua_popen(L,c,m) ((void)L, _popen(c,m))
|
||||
#define lua_pclose(L,file) ((void)L, _pclose(file))
|
||||
|
||||
#define lua_popen(L,c,m) (_popen(c,m))
|
||||
#define lua_pclose(L,file) (_pclose(file))
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
#define lua_popen(L,c,m) ((void)((void)c, m), \
|
||||
luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
|
||||
/* ANSI definitions */
|
||||
#define lua_popen(L,c,m) \
|
||||
((void)((void)c, m), \
|
||||
luaL_error(L, LUA_QL("popen") " not supported"), \
|
||||
(FILE*)0)
|
||||
#define lua_pclose(L,file) ((void)((void)L, file), -1)
|
||||
|
||||
|
||||
#endif /* } */
|
||||
|
||||
#endif /* } */
|
||||
#endif /* } */
|
||||
|
||||
/* }====================================================== */
|
||||
|
||||
@@ -84,7 +85,7 @@
|
||||
** =======================================================
|
||||
*/
|
||||
|
||||
#if !defined(lua_fseek) && !defined(LUA_ANSI) /* { */
|
||||
#if !defined(lua_fseek) /* { */
|
||||
|
||||
#if defined(LUA_USE_POSIX) /* { */
|
||||
|
||||
@@ -94,22 +95,22 @@
|
||||
|
||||
#elif defined(LUA_WIN) && !defined(_CRTIMP_TYPEINFO) \
|
||||
&& defined(_MSC_VER) && (_MSC_VER >= 1400) /* }{ */
|
||||
/* Windows (but not DDK) and Visual C++ 2005 or higher */
|
||||
|
||||
/* 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
|
||||
|
||||
#endif /* } */
|
||||
#else /* }{ */
|
||||
|
||||
#endif /* } */
|
||||
|
||||
|
||||
#if !defined(l_fseek) /* default definitions */
|
||||
/* ANSI definitions */
|
||||
#define l_fseek(f,o,w) fseek(f,o,w)
|
||||
#define l_ftell(f) ftell(f)
|
||||
#define l_seeknum long
|
||||
#endif
|
||||
|
||||
#endif /* } */
|
||||
|
||||
#endif /* } */
|
||||
|
||||
/* }====================================================== */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user