Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

5 changed files:

Changes:

  • src/code/save.lisp
    ... ... @@ -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)
    

  • src/code/unix.lisp
    ... ... @@ -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))))

  • src/general-info/release-21e.md
    ... ... @@ -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:
    

  • src/i18n/locale/cmucl-unix.pot
    ... ... @@ -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
    +

  • src/lisp/os-common.c
    ... ... @@ -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
    +}