about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wrapped32/generated/functions_list.txt1
-rw-r--r--src/wrapped32/generated/wrappedlibctypes32.h1
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c44
-rwxr-xr-xsrc/wrapped32/wrappedlibc_private.h2
4 files changed, 47 insertions, 1 deletions
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index 031b8f65..01f97b17 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -264,6 +264,7 @@ wrappedlibc:
   - __ctype_tolower_loc
   - __ctype_toupper_loc
   - __errno_location
+  - localeconv
 - pFL:
 - pFp:
   - gethostbyname
diff --git a/src/wrapped32/generated/wrappedlibctypes32.h b/src/wrapped32/generated/wrappedlibctypes32.h
index 0c9a12b1..f9eb31aa 100644
--- a/src/wrapped32/generated/wrappedlibctypes32.h
+++ b/src/wrapped32/generated/wrappedlibctypes32.h
@@ -81,6 +81,7 @@ typedef int32_t (*iFpuvvppp_t)(void*, uint32_t, void, void, void*, void*, void*)
 	GO(__ctype_tolower_loc, pFv_t) \
 	GO(__ctype_toupper_loc, pFv_t) \
 	GO(__errno_location, pFv_t) \
+	GO(localeconv, pFv_t) \
 	GO(gethostbyname, pFp_t) \
 	GO(getrlimit, iFip_t) \
 	GO(setrlimit, iFip_t) \
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index 52a8c408..5100dd00 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -2495,6 +2495,50 @@ EXPORT void* my32_backtrace_symbols(x64emu_t* emu, ptr_t* buffer, int size)
     return ret;
 }
 
+struct i386_lconv
+{
+  ptr_t decimal_point;  // char *
+  ptr_t thousands_sep;  // char *
+  ptr_t grouping;       // char *
+  ptr_t int_curr_symbol; // char *
+  ptr_t currency_symbol; // char *
+  ptr_t mon_decimal_point; // char *
+  ptr_t mon_thousands_sep; // char *
+  ptr_t mon_grouping; // char *
+  ptr_t positive_sign; // char *
+  ptr_t negative_sign; // char *
+  char int_frac_digits;
+  char frac_digits;
+  char p_cs_precedes;
+  char p_sep_by_space;
+  char n_cs_precedes;
+  char n_sep_by_space;
+  char p_sign_posn;
+  char n_sign_posn;
+  char int_p_cs_precedes;
+  char int_p_sep_by_space;
+  char int_n_cs_precedes;
+  char int_n_sep_by_space;
+  char int_p_sign_posn;
+  char int_n_sign_posn;
+};
+EXPORT void* my32_localeconv(x64emu_t* emu)
+{
+    static struct i386_lconv ret = {0};
+    struct lconv* l = localeconv();
+    ret.decimal_point = to_cstring(l->decimal_point);
+    ret.grouping = to_cstring(l->grouping);
+    ret.int_curr_symbol = to_cstring(l->int_curr_symbol);
+    ret.currency_symbol = to_cstring(l->currency_symbol);
+    ret.mon_decimal_point = to_cstring(l->mon_decimal_point);
+    ret.mon_thousands_sep = to_cstring(l->mon_thousands_sep);
+    ret.mon_grouping = to_cstring(l->mon_grouping);
+    ret.positive_sign = to_cstring(l->positive_sign);
+    ret.negative_sign = to_cstring(l->negative_sign);
+    memcpy(&ret.int_frac_digits, &l->int_frac_digits, 14);
+    return &ret;
+}
+
 
 EXPORT struct __processor_model
 {
diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h
index c995d249..09ec3655 100755
--- a/src/wrapped32/wrappedlibc_private.h
+++ b/src/wrapped32/wrappedlibc_private.h
@@ -1027,7 +1027,7 @@ GOW(listen, iFii)
 // llseek   // Weak
 // loc1 // type B
 // loc2 // type B
-//GOW(localeconv, pFv)
+GOWM(localeconv, pFEv)
 //GO(localtime, pFp)
 GOWM(localtime_r, pFEpp)
 GO(lockf, iFiiu)