Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
-
33c760fa
by Raymond Toy at 2022-11-03T04:47:09+00:00
-
317a33f8
by Raymond Toy at 2022-11-03T04:47:10+00:00
5 changed files:
- src/code/save.lisp
- src/code/unix.lisp
- src/general-info/release-21e.md
- src/i18n/locale/cmucl-unix.pot
- src/lisp/os-common.c
Changes:
... | ... | @@ -249,6 +249,10 @@ |
249 | 249 | (reinit)
|
250 | 250 | (environment-init)
|
251 | 251 | (dolist (f *after-save-initializations*) (funcall f))
|
252 | + ;; Set the runtime locale
|
|
253 | + (unless (zerop (unix::unix-setlocale))
|
|
254 | + (warn "os_setlocale failed"))
|
|
255 | + ;; Set the locale for lisp
|
|
252 | 256 | (intl::setlocale)
|
253 | 257 | (ext::process-command-strings process-command-line)
|
254 | 258 | (setf *editor-lisp-p* nil)
|
... | ... | @@ -2893,3 +2893,9 @@ |
2893 | 2893 | of the child in the parent if it works, or NIL and an error number if it
|
2894 | 2894 | doesn't work."
|
2895 | 2895 | (int-syscall ("fork")))
|
2896 | + |
|
2897 | +(defun unix-setlocale ()
|
|
2898 | + _N"Call setlocale(3c) with fixed args. Returns 0 on success."
|
|
2899 | + (alien:alien-funcall
|
|
2900 | + (alien:extern-alien "os_setlocale"
|
|
2901 | + (function c-call:int)))) |
... | ... | @@ -61,7 +61,8 @@ public domain. |
61 | 61 | * ~~#136~~ `ensure-directories-exist` should return the given pathspec
|
62 | 62 | * #139 `*default-external-format*` defaults to `:utf-8`
|
63 | 63 | * ~~#142~~ `(random 0)` signals incorrect error
|
64 | - * ~~#147~~ `stream-line-column` method missing for `fundamental-character-output-stream`
|
|
64 | + * ~~#147~~ `stream-line-column` method missing for `fundamental-character-output-stream`
|
|
65 | + * ~~#149~~ Call setlocale(3C) on startup
|
|
65 | 66 | * Other changes:
|
66 | 67 | * Improvements to the PCL implementation of CLOS:
|
67 | 68 | * Changes to building procedure:
|
... | ... | @@ -1424,3 +1424,7 @@ msgid "" |
1424 | 1424 | " doesn't work."
|
1425 | 1425 | msgstr ""
|
1426 | 1426 | |
1427 | +#: src/code/unix.lisp
|
|
1428 | +msgid "Call setlocale(3c) with fixed args. Returns 0 on success."
|
|
1429 | +msgstr ""
|
|
1430 | + |
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | |
8 | 8 | #include <assert.h>
|
9 | 9 | #include <errno.h>
|
10 | +#include <locale.h>
|
|
10 | 11 | #include <math.h>
|
11 | 12 | #include <netdb.h>
|
12 | 13 | #include <pwd.h>
|
... | ... | @@ -773,3 +774,12 @@ exit: |
773 | 774 |
|
774 | 775 | return result;
|
775 | 776 | }
|
777 | + |
|
778 | +int
|
|
779 | +os_setlocale(void)
|
|
780 | +{
|
|
781 | + char *result = setlocale(LC_ALL, "");
|
|
782 | + |
|
783 | + /* Return 0 if setlocale suceeded; otherwise -1. */
|
|
784 | + return result != NULL ? 0 : -1;
|
|
785 | +} |