diff options
Diffstat (limited to 'src/lib_os.c')
-rw-r--r-- | src/lib_os.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib_os.c b/src/lib_os.c index f62e8c8b..713ec935 100644 --- a/src/lib_os.c +++ b/src/lib_os.c | |||
@@ -7,7 +7,6 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <errno.h> | 9 | #include <errno.h> |
10 | #include <locale.h> | ||
11 | #include <time.h> | 10 | #include <time.h> |
12 | 11 | ||
13 | #define lib_os_c | 12 | #define lib_os_c |
@@ -27,6 +26,10 @@ | |||
27 | #include <stdio.h> | 26 | #include <stdio.h> |
28 | #endif | 27 | #endif |
29 | 28 | ||
29 | #if !LJ_TARGET_PSVITA | ||
30 | #include <locale.h> | ||
31 | #endif | ||
32 | |||
30 | /* ------------------------------------------------------------------------ */ | 33 | /* ------------------------------------------------------------------------ */ |
31 | 34 | ||
32 | #define LJLIB_MODULE_os | 35 | #define LJLIB_MODULE_os |
@@ -70,7 +73,7 @@ LJLIB_CF(os_rename) | |||
70 | 73 | ||
71 | LJLIB_CF(os_tmpname) | 74 | LJLIB_CF(os_tmpname) |
72 | { | 75 | { |
73 | #if LJ_TARGET_PS3 || LJ_TARGET_PS4 | 76 | #if LJ_TARGET_PS3 || LJ_TARGET_PS4 || LJ_TARGET_PSVITA |
74 | lj_err_caller(L, LJ_ERR_OSUNIQF); | 77 | lj_err_caller(L, LJ_ERR_OSUNIQF); |
75 | return 0; | 78 | return 0; |
76 | #else | 79 | #else |
@@ -254,6 +257,9 @@ LJLIB_CF(os_difftime) | |||
254 | 257 | ||
255 | LJLIB_CF(os_setlocale) | 258 | LJLIB_CF(os_setlocale) |
256 | { | 259 | { |
260 | #if LJ_TARGET_PSVITA | ||
261 | lua_pushliteral(L, "C"); | ||
262 | #else | ||
257 | GCstr *s = lj_lib_optstr(L, 1); | 263 | GCstr *s = lj_lib_optstr(L, 1); |
258 | const char *str = s ? strdata(s) : NULL; | 264 | const char *str = s ? strdata(s) : NULL; |
259 | int opt = lj_lib_checkopt(L, 2, 6, | 265 | int opt = lj_lib_checkopt(L, 2, 6, |
@@ -265,6 +271,7 @@ LJLIB_CF(os_setlocale) | |||
265 | else if (opt == 4) opt = LC_MONETARY; | 271 | else if (opt == 4) opt = LC_MONETARY; |
266 | else if (opt == 6) opt = LC_ALL; | 272 | else if (opt == 6) opt = LC_ALL; |
267 | lua_pushstring(L, setlocale(opt, str)); | 273 | lua_pushstring(L, setlocale(opt, str)); |
274 | #endif | ||
268 | return 1; | 275 | return 1; |
269 | } | 276 | } |
270 | 277 | ||