diff options
author | Eric Cosatto <cosatto@nec-labs.com> | 2016-06-01 16:52:07 -0400 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2016-06-01 17:52:07 -0300 |
commit | 6e0dc7b27ce6e8a56d646071b69d7e46c85dd245 (patch) | |
tree | ab3b2d73d27588810c3c6f232405fa28796eb344 | |
parent | 1937ba848b275408e837fb49dc8a83eca6a031fe (diff) | |
download | luafilesystem-6e0dc7b27ce6e8a56d646071b69d7e46c85dd245.tar.gz luafilesystem-6e0dc7b27ce6e8a56d646071b69d7e46c85dd245.tar.bz2 luafilesystem-6e0dc7b27ce6e8a56d646071b69d7e46c85dd245.zip |
Fix export of luaopen_lfs on Windows (#74)
* Make lfs export luaopen_lfs under Windows
-rw-r--r-- | src/lfs.c | 2 | ||||
-rw-r--r-- | src/lfs.h | 24 |
2 files changed, 14 insertions, 12 deletions
@@ -887,7 +887,7 @@ static const struct luaL_Reg fslib[] = { | |||
887 | {NULL, NULL}, | 887 | {NULL, NULL}, |
888 | }; | 888 | }; |
889 | 889 | ||
890 | int luaopen_lfs (lua_State *L) { | 890 | LFS_EXPORT int luaopen_lfs (lua_State *L) { |
891 | dir_create_meta (L); | 891 | dir_create_meta (L); |
892 | lock_create_meta (L); | 892 | lock_create_meta (L); |
893 | luaL_newlib (L, fslib); | 893 | luaL_newlib (L, fslib); |
@@ -5,27 +5,29 @@ | |||
5 | 5 | ||
6 | /* Define 'chdir' for systems that do not implement it */ | 6 | /* Define 'chdir' for systems that do not implement it */ |
7 | #ifdef NO_CHDIR | 7 | #ifdef NO_CHDIR |
8 | #define chdir(p) (-1) | 8 | #define chdir(p) (-1) |
9 | #define chdir_error "Function 'chdir' not provided by system" | 9 | #define chdir_error "Function 'chdir' not provided by system" |
10 | #else | 10 | #else |
11 | #define chdir_error strerror(errno) | 11 | #define chdir_error strerror(errno) |
12 | |||
13 | #endif | 12 | #endif |
14 | 13 | ||
15 | #ifdef _WIN32 | 14 | #ifdef _WIN32 |
16 | #define chdir(p) (_chdir(p)) | 15 | #define chdir(p) (_chdir(p)) |
17 | #define getcwd(d, s) (_getcwd(d, s)) | 16 | #define getcwd(d, s) (_getcwd(d, s)) |
18 | #define rmdir(p) (_rmdir(p)) | 17 | #define rmdir(p) (_rmdir(p)) |
19 | #ifndef fileno | 18 | #define LFS_EXPORT __declspec (dllexport) |
20 | #define fileno(f) (_fileno(f)) | 19 | #ifndef fileno |
21 | #endif | 20 | #define fileno(f) (_fileno(f)) |
21 | #endif | ||
22 | #else | ||
23 | #define LFS_EXPORT | ||
22 | #endif | 24 | #endif |
23 | 25 | ||
24 | #ifdef __cplusplus | 26 | #ifdef __cplusplus |
25 | extern "C" { | 27 | extern "C" { |
26 | #endif | 28 | #endif |
27 | 29 | ||
28 | int luaopen_lfs (lua_State *L); | 30 | LFS_EXPORT int luaopen_lfs (lua_State *L); |
29 | 31 | ||
30 | #ifdef __cplusplus | 32 | #ifdef __cplusplus |
31 | } | 33 | } |