diff --git a/libguile/locale-categories.h b/libguile/locale-categories.h index 26b030dc5..fb5ac1081 100644 --- a/libguile/locale-categories.h +++ b/libguile/locale-categories.h @@ -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 * 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 (CTYPE) -#ifdef LC_MESSAGES -/* MinGW doesn't have `LC_MESSAGES'. */ +#if defined(LC_MESSAGES) && !(defined(LC_MAX) && LC_MESSAGES > LC_MAX) +/* 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) #endif diff --git a/test-suite/tests/i18n.test b/test-suite/tests/i18n.test index b980cdcdb..68ae38c23 100644 --- a/test-suite/tests/i18n.test +++ b/test-suite/tests/i18n.test @@ -1,7 +1,7 @@ ;;;; i18n.test --- Exercise the i18n API. -*- coding: utf-8; mode: scheme; -*- ;;;; ;;;; Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012, -;;;; 2013 Free Software Foundation, Inc. +;;;; 2013, 2014 Free Software Foundation, Inc. ;;;; Ludovic Courtès ;;;; ;;;; This library is free software; you can redistribute it and/or @@ -38,18 +38,18 @@ (not (not (make-locale LC_ALL "C")))) (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)" (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 (make-locale LC_ALL "does-not-exist")) (pass-if "locale?" (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"))))) (pass-if "%global-locale"