diff options
Diffstat (limited to 'src/lib_io.c')
-rw-r--r-- | src/lib_io.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib_io.c b/src/lib_io.c index 787fdc6b..878b98af 100644 --- a/src/lib_io.c +++ b/src/lib_io.c | |||
@@ -114,9 +114,9 @@ static int io_file_close(lua_State *L, IOFileUD *iof) | |||
114 | if ((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_FILE) { | 114 | if ((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_FILE) { |
115 | ok = (fclose(iof->fp) == 0); | 115 | ok = (fclose(iof->fp) == 0); |
116 | } else if ((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_PIPE) { | 116 | } else if ((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_PIPE) { |
117 | #if defined(LUA_USE_POSIX) | 117 | #if LJ_TARGET_POSIX |
118 | ok = (pclose(iof->fp) != -1); | 118 | ok = (pclose(iof->fp) != -1); |
119 | #elif defined(LUA_USE_WIN) | 119 | #elif LJ_TARGET_WINDOWS |
120 | ok = (_pclose(iof->fp) != -1); | 120 | ok = (_pclose(iof->fp) != -1); |
121 | #else | 121 | #else |
122 | ok = 0; | 122 | ok = 0; |
@@ -289,7 +289,7 @@ LJLIB_CF(io_method_seek) | |||
289 | , | 289 | , |
290 | ofs = 0; | 290 | ofs = 0; |
291 | ) | 291 | ) |
292 | #if defined(LUA_USE_POSIX) | 292 | #if LJ_TARGET_POSIX |
293 | res = fseeko(fp, (int64_t)ofs, opt); | 293 | res = fseeko(fp, (int64_t)ofs, opt); |
294 | #elif _MSC_VER >= 1400 | 294 | #elif _MSC_VER >= 1400 |
295 | res = _fseeki64(fp, (int64_t)ofs, opt); | 295 | res = _fseeki64(fp, (int64_t)ofs, opt); |
@@ -300,7 +300,7 @@ LJLIB_CF(io_method_seek) | |||
300 | #endif | 300 | #endif |
301 | if (res) | 301 | if (res) |
302 | return io_pushresult(L, 0, NULL); | 302 | return io_pushresult(L, 0, NULL); |
303 | #if defined(LUA_USE_POSIX) | 303 | #if LJ_TARGET_POSIX |
304 | ofs = cast_num(ftello(fp)); | 304 | ofs = cast_num(ftello(fp)); |
305 | #elif _MSC_VER >= 1400 | 305 | #elif _MSC_VER >= 1400 |
306 | ofs = cast_num(_ftelli64(fp)); | 306 | ofs = cast_num(_ftelli64(fp)); |
@@ -374,13 +374,13 @@ LJLIB_CF(io_open) | |||
374 | 374 | ||
375 | LJLIB_CF(io_popen) | 375 | LJLIB_CF(io_popen) |
376 | { | 376 | { |
377 | #if defined(LUA_USE_POSIX) || defined(LUA_USE_WIN) | 377 | #if LJ_TARGET_POSIX || LJ_TARGET_WINDOWS |
378 | const char *fname = strdata(lj_lib_checkstr(L, 1)); | 378 | const char *fname = strdata(lj_lib_checkstr(L, 1)); |
379 | GCstr *s = lj_lib_optstr(L, 2); | 379 | GCstr *s = lj_lib_optstr(L, 2); |
380 | const char *mode = s ? strdata(s) : "r"; | 380 | const char *mode = s ? strdata(s) : "r"; |
381 | IOFileUD *iof = io_file_new(L); | 381 | IOFileUD *iof = io_file_new(L); |
382 | iof->type = IOFILE_TYPE_PIPE; | 382 | iof->type = IOFILE_TYPE_PIPE; |
383 | #ifdef LUA_USE_POSIX | 383 | #if LJ_TARGET_POSIX |
384 | fflush(NULL); | 384 | fflush(NULL); |
385 | iof->fp = popen(fname, mode); | 385 | iof->fp = popen(fname, mode); |
386 | #else | 386 | #else |