diff options
author | tomas <tomas> | 2007-08-30 14:39:45 +0000 |
---|---|---|
committer | tomas <tomas> | 2007-08-30 14:39:45 +0000 |
commit | aeca787ff3710cba50b1f4b76f75ba86f4c1fc66 (patch) | |
tree | 73902483a03ad393519af128e42b1bf29653ba17 | |
parent | 1cfd57550e6323646c4619e7235e7b993add1783 (diff) | |
download | luafilesystem-aeca787ff3710cba50b1f4b76f75ba86f4c1fc66.tar.gz luafilesystem-aeca787ff3710cba50b1f4b76f75ba86f4c1fc66.tar.bz2 luafilesystem-aeca787ff3710cba50b1f4b76f75ba86f4c1fc66.zip |
Improving conditional compilation for Windows version (thanks to Varol Kaptan)
-rw-r--r-- | src/lfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -15,7 +15,7 @@ | |||
15 | ** lfs.touch (filepath [, atime [, mtime]]) | 15 | ** lfs.touch (filepath [, atime [, mtime]]) |
16 | ** lfs.unlock (fh) | 16 | ** lfs.unlock (fh) |
17 | ** | 17 | ** |
18 | ** $Id: lfs.c,v 1.39 2007/06/22 12:44:46 tomas Exp $ | 18 | ** $Id: lfs.c,v 1.40 2007/08/30 14:39:45 tomas Exp $ |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <errno.h> | 21 | #include <errno.h> |
@@ -529,6 +529,7 @@ static int _file_info_ (lua_State *L, int (*st)(const char*, struct stat*)) { | |||
529 | const char *member = lua_tostring (L, 2); | 529 | const char *member = lua_tostring (L, 2); |
530 | if (strcmp (member, "mode") == 0) v = 0; | 530 | if (strcmp (member, "mode") == 0) v = 0; |
531 | #ifndef _WIN32 | 531 | #ifndef _WIN32 |
532 | else if (strcmp (member, "blocks") == 0) v = 11; | ||
532 | else if (strcmp (member, "blksize") == 0) v = 12; | 533 | else if (strcmp (member, "blksize") == 0) v = 12; |
533 | #endif | 534 | #endif |
534 | else /* look for member */ | 535 | else /* look for member */ |
@@ -562,9 +563,11 @@ static int file_info (lua_State *L) { | |||
562 | /* | 563 | /* |
563 | ** Get symbolic link information using lstat. | 564 | ** Get symbolic link information using lstat. |
564 | */ | 565 | */ |
566 | #ifndef _WIN32 | ||
565 | static int link_info (lua_State *L) { | 567 | static int link_info (lua_State *L) { |
566 | return _file_info_ (L, lstat); | 568 | return _file_info_ (L, lstat); |
567 | } | 569 | } |
570 | #endif | ||
568 | 571 | ||
569 | 572 | ||
570 | /* | 573 | /* |
@@ -591,7 +594,9 @@ static const struct luaL_reg fslib[] = { | |||
591 | {"lock", file_lock}, | 594 | {"lock", file_lock}, |
592 | {"mkdir", make_dir}, | 595 | {"mkdir", make_dir}, |
593 | {"rmdir", remove_dir}, | 596 | {"rmdir", remove_dir}, |
597 | #ifndef _WIN32 | ||
594 | {"symlinkattributes", link_info}, | 598 | {"symlinkattributes", link_info}, |
599 | #endif | ||
595 | {"touch", file_utime}, | 600 | {"touch", file_utime}, |
596 | {"unlock", file_unlock}, | 601 | {"unlock", file_unlock}, |
597 | {NULL, NULL}, | 602 | {NULL, NULL}, |