1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

WIN32: new internal define %UCRT when compiled with UCRT C library

This variable will help indicate if, on Win32, the C library is
closer to C99 capable.

* libguile/posix.c (scm_init_posix): new define %UCRT
* test-suite/tests/i18n.test (old-ms?): use new define allow UTF-8
    tests on MINGW
This commit is contained in:
Michael Gran 2023-07-04 16:50:31 -07:00
parent 0f748b32aa
commit c8e0454692
2 changed files with 15 additions and 2 deletions

View file

@ -2698,6 +2698,10 @@ scm_init_posix ()
#ifdef AT_EACCESS
scm_c_define ("AT_EACCESS", scm_from_int (AT_EACCESS));
#endif
#ifdef _UCRT
/* When defined, Windows systems are using the UCRT library. */
scm_c_define ("%UCRT", scm_from_int (1));
#endif
#include "cpp-SIG.c"
#include "posix.x"

View file

@ -86,8 +86,17 @@
(not (string-locale<? large large))))))
(define mingw?
(string-contains %host-type "-mingw32"))
;; | Type | 8-bit default | 8-bit specific | UTF-8 |
;; +--------+---------------+--------------------+------------+
;; | POSIX | fr_FR | fr_fr.iso88591 | fr_FR.utf8 |
;; | Old MS | France_French | France_French.1252 | N/A |
;; | BCP 47 | fr-FR | fr-FR.1252 | fr-FR.utf8 |
;; +--------+---------------+--------------------+------------+
;; Old MS is MinGW using deprecated MSVCRT C library.
;; MinGW with UCRT C library prefers BCP 47 and can fall back to Old MS.
(define old-ms?
(and (string-contains %host-type "-mingw32")
(not (defined? '%UCRT))))
(define %french-locale-name
(if mingw?