diff options
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 41 |
1 files changed, 21 insertions, 20 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.115 2014/01/27 13:28:45 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.116 2014/02/21 14:39:50 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -51,29 +51,30 @@ | |||
51 | ** ======================================================= | 51 | ** ======================================================= |
52 | */ | 52 | */ |
53 | 53 | ||
54 | #if !defined(lua_popen) /* { */ | 54 | #if !defined(lua_popen) /* { */ |
55 | 55 | ||
56 | #if defined(LUA_USE_POPEN) /* { */ | 56 | #if defined(LUA_USE_POSIX) /* { */ |
57 | 57 | ||
58 | #define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) | 58 | #define lua_popen(L,c,m) (fflush(NULL), popen(c,m)) |
59 | #define lua_pclose(L,file) ((void)L, pclose(file)) | 59 | #define lua_pclose(L,file) (pclose(file)) |
60 | 60 | ||
61 | #elif defined(LUA_WIN) /* }{ */ | 61 | #elif defined(LUA_WIN) /* }{ */ |
62 | 62 | ||
63 | #define lua_popen(L,c,m) ((void)L, _popen(c,m)) | 63 | #define lua_popen(L,c,m) (_popen(c,m)) |
64 | #define lua_pclose(L,file) ((void)L, _pclose(file)) | 64 | #define lua_pclose(L,file) (_pclose(file)) |
65 | |||
66 | 65 | ||
67 | #else /* }{ */ | 66 | #else /* }{ */ |
68 | 67 | ||
69 | #define lua_popen(L,c,m) ((void)((void)c, m), \ | 68 | /* ANSI definitions */ |
70 | luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) | 69 | #define lua_popen(L,c,m) \ |
70 | ((void)((void)c, m), \ | ||
71 | luaL_error(L, LUA_QL("popen") " not supported"), \ | ||
72 | (FILE*)0) | ||
71 | #define lua_pclose(L,file) ((void)((void)L, file), -1) | 73 | #define lua_pclose(L,file) ((void)((void)L, file), -1) |
72 | 74 | ||
73 | |||
74 | #endif /* } */ | 75 | #endif /* } */ |
75 | 76 | ||
76 | #endif /* } */ | 77 | #endif /* } */ |
77 | 78 | ||
78 | /* }====================================================== */ | 79 | /* }====================================================== */ |
79 | 80 | ||
@@ -84,7 +85,7 @@ | |||
84 | ** ======================================================= | 85 | ** ======================================================= |
85 | */ | 86 | */ |
86 | 87 | ||
87 | #if !defined(lua_fseek) && !defined(LUA_ANSI) /* { */ | 88 | #if !defined(lua_fseek) /* { */ |
88 | 89 | ||
89 | #if defined(LUA_USE_POSIX) /* { */ | 90 | #if defined(LUA_USE_POSIX) /* { */ |
90 | 91 | ||
@@ -94,22 +95,22 @@ | |||
94 | 95 | ||
95 | #elif defined(LUA_WIN) && !defined(_CRTIMP_TYPEINFO) \ | 96 | #elif defined(LUA_WIN) && !defined(_CRTIMP_TYPEINFO) \ |
96 | && defined(_MSC_VER) && (_MSC_VER >= 1400) /* }{ */ | 97 | && defined(_MSC_VER) && (_MSC_VER >= 1400) /* }{ */ |
97 | /* Windows (but not DDK) and Visual C++ 2005 or higher */ | ||
98 | 98 | ||
99 | /* Windows (but not DDK) and Visual C++ 2005 or higher */ | ||
99 | #define l_fseek(f,o,w) _fseeki64(f,o,w) | 100 | #define l_fseek(f,o,w) _fseeki64(f,o,w) |
100 | #define l_ftell(f) _ftelli64(f) | 101 | #define l_ftell(f) _ftelli64(f) |
101 | #define l_seeknum __int64 | 102 | #define l_seeknum __int64 |
102 | 103 | ||
103 | #endif /* } */ | 104 | #else /* }{ */ |
104 | |||
105 | #endif /* } */ | ||
106 | |||
107 | 105 | ||
108 | #if !defined(l_fseek) /* default definitions */ | 106 | /* ANSI definitions */ |
109 | #define l_fseek(f,o,w) fseek(f,o,w) | 107 | #define l_fseek(f,o,w) fseek(f,o,w) |
110 | #define l_ftell(f) ftell(f) | 108 | #define l_ftell(f) ftell(f) |
111 | #define l_seeknum long | 109 | #define l_seeknum long |
112 | #endif | 110 | |
111 | #endif /* } */ | ||
112 | |||
113 | #endif /* } */ | ||
113 | 114 | ||
114 | /* }====================================================== */ | 115 | /* }====================================================== */ |
115 | 116 | ||