Merge branch 'master' into v2.1
This commit is contained in:
11
src/lib_os.c
11
src/lib_os.c
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include <time.h>
|
||||
|
||||
#define lib_os_c
|
||||
@@ -30,6 +29,10 @@
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if !LJ_TARGET_PSVITA
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
#define LJLIB_MODULE_os
|
||||
@@ -73,7 +76,7 @@ LJLIB_CF(os_rename)
|
||||
|
||||
LJLIB_CF(os_tmpname)
|
||||
{
|
||||
#if LJ_TARGET_PS3 || LJ_TARGET_PS4
|
||||
#if LJ_TARGET_PS3 || LJ_TARGET_PS4 || LJ_TARGET_PSVITA
|
||||
lj_err_caller(L, LJ_ERR_OSUNIQF);
|
||||
return 0;
|
||||
#else
|
||||
@@ -259,6 +262,9 @@ LJLIB_CF(os_difftime)
|
||||
|
||||
LJLIB_CF(os_setlocale)
|
||||
{
|
||||
#if LJ_TARGET_PSVITA
|
||||
lua_pushliteral(L, "C");
|
||||
#else
|
||||
GCstr *s = lj_lib_optstr(L, 1);
|
||||
const char *str = s ? strdata(s) : NULL;
|
||||
int opt = lj_lib_checkopt(L, 2, 6,
|
||||
@@ -270,6 +276,7 @@ LJLIB_CF(os_setlocale)
|
||||
else if (opt == 4) opt = LC_MONETARY;
|
||||
else if (opt == 6) opt = LC_ALL;
|
||||
lua_pushstring(L, setlocale(opt, str));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user