1 /* Determine whether a locale is hard.
3 * Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2022 Free Software
6 * Imported from Gnulib hard-locale.[ch] with modifications by Nick Bowler:
8 * - Remove all setlocale workarounds, as our use case does not do anything
9 * fancy with locales and does not require thread safety (2024-01).
11 * This file is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation; either version 2.1 of the
14 * License, or (at your option) any later version.
16 * This file is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 #ifndef HARD_LOCALE_H_
26 #define HARD_LOCALE_H_
31 static inline int hard_locale(int locale)
35 if (!(name = setlocale(locale, NULL)))
38 return strcmp(name, "C") && strcmp(name, "POSIX");