1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 06:20:23 +02:00

i18n: Ignore LC_MESSAGES on MinGW.

* libguile/locale-categories.h (MESSAGES): Add condition on
  !(defined(LC_MAX) && LC_MESSAGES > LC_MAX).
* test-suite/tests/i18n.test ("locale objects")["make-locale (2 args,
  list)", "make-locale (3 args)", "locale?"]: Use LC_NUMERIC or LC_TIME
  instead of LC_MESSAGES.

Co-authored-by: Eli Zaretskii <eliz@gnu.org>
This commit is contained in:
Ludovic Courtès 2014-06-11 14:54:21 +02:00
parent 82b8cfa40c
commit c84f25bcce
2 changed files with 9 additions and 7 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2006, 2008 Free Software Foundation, Inc. /* Copyright (C) 2006, 2008, 2014 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -23,8 +23,10 @@
SCM_DEFINE_LOCALE_CATEGORY (COLLATE) SCM_DEFINE_LOCALE_CATEGORY (COLLATE)
SCM_DEFINE_LOCALE_CATEGORY (CTYPE) SCM_DEFINE_LOCALE_CATEGORY (CTYPE)
#ifdef LC_MESSAGES #if defined(LC_MESSAGES) && !(defined(LC_MAX) && LC_MESSAGES > LC_MAX)
/* MinGW doesn't have `LC_MESSAGES'. */ /* MinGW doesn't have `LC_MESSAGES'. libintl.h might define
`LC_MESSAGES' for MinGW to an arbitrary large value which we cannot
use in a call to `setlocale'. */
SCM_DEFINE_LOCALE_CATEGORY (MESSAGES) SCM_DEFINE_LOCALE_CATEGORY (MESSAGES)
#endif #endif

View file

@ -1,7 +1,7 @@
;;;; i18n.test --- Exercise the i18n API. -*- coding: utf-8; mode: scheme; -*- ;;;; i18n.test --- Exercise the i18n API. -*- coding: utf-8; mode: scheme; -*-
;;;; ;;;;
;;;; Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012, ;;;; Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012,
;;;; 2013 Free Software Foundation, Inc. ;;;; 2013, 2014 Free Software Foundation, Inc.
;;;; Ludovic Courtès ;;;; Ludovic Courtès
;;;; ;;;;
;;;; This library is free software; you can redistribute it and/or ;;;; This library is free software; you can redistribute it and/or
@ -38,18 +38,18 @@
(not (not (make-locale LC_ALL "C")))) (not (not (make-locale LC_ALL "C"))))
(pass-if "make-locale (2 args, list)" (pass-if "make-locale (2 args, list)"
(not (not (make-locale (list LC_COLLATE LC_MESSAGES) "C")))) (not (not (make-locale (list LC_COLLATE LC_NUMERIC) "C"))))
(pass-if "make-locale (3 args)" (pass-if "make-locale (3 args)"
(not (not (make-locale (list LC_COLLATE) "C" (not (not (make-locale (list LC_COLLATE) "C"
(make-locale (list LC_MESSAGES) "C"))))) (make-locale (list LC_NUMERIC) "C")))))
(pass-if-exception "make-locale with unknown locale" exception:locale-error (pass-if-exception "make-locale with unknown locale" exception:locale-error
(make-locale LC_ALL "does-not-exist")) (make-locale LC_ALL "does-not-exist"))
(pass-if "locale?" (pass-if "locale?"
(and (locale? (make-locale (list LC_ALL) "C")) (and (locale? (make-locale (list LC_ALL) "C"))
(locale? (make-locale (list LC_MESSAGES LC_NUMERIC) "C" (locale? (make-locale (list LC_TIME LC_NUMERIC) "C"
(make-locale (list LC_CTYPE) "C"))))) (make-locale (list LC_CTYPE) "C")))))
(pass-if "%global-locale" (pass-if "%global-locale"