scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit fed392c7899bb4e94df0e1790dc4bd01e253f578
parent e1574e8a5c51b6a316947694cf70192ee98f9b6a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 27 Aug 2021 11:44:57 +0200

libc: Update locale to last version

This code is being updated out of the tree of scc and
it is time to synchroniza both copies now.

Diffstat:
Msrc/libc/locale/localeconv.c | 11+++++++++--
Msrc/libc/locale/setlocale.c | 8++++----
2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/libc/locale/localeconv.c b/src/libc/locale/localeconv.c @@ -1,5 +1,6 @@ -#include <locale.h> #include <limits.h> +#include <locale.h> + #undef localeconv struct lconv * @@ -20,10 +21,16 @@ localeconv(void) .p_cs_precedes = CHAR_MAX, .n_cs_precedes = CHAR_MAX, .p_sep_by_space = CHAR_MAX, - .p_sign_posn = CHAR_MAX, .n_sep_by_space = CHAR_MAX, + .p_sign_posn = CHAR_MAX, .n_sign_posn = CHAR_MAX, .int_frac_digits = CHAR_MAX, + .int_p_cs_precedes = CHAR_MAX, + .int_n_cs_precedes = CHAR_MAX, + .int_p_sep_by_space = CHAR_MAX, + .int_n_sep_by_space = CHAR_MAX, + .int_p_sign_posn = CHAR_MAX, + .int_n_sign_posn = CHAR_MAX, }; return &lc; } diff --git a/src/libc/locale/setlocale.c b/src/libc/locale/setlocale.c @@ -1,5 +1,5 @@ #include <locale.h> -#include <stddef.h> + #undef setlocale char * @@ -7,9 +7,9 @@ setlocale(int category, const char *locale) { if (category > LC_TIME || category < LC_ALL) return NULL; - if (!locale || - locale[0] == '\0' || - locale[0] == 'C' && locale[1] == '\0') { + if (!locale + || locale[0] == '\0' + || locale[0] == 'C' && locale[1] == '\0') { return "C"; } return NULL;