summaryrefslogtreecommitdiff
path: root/lib/locale.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/locale.in.h')
-rw-r--r--lib/locale.in.h37
1 files changed, 21 insertions, 16 deletions
diff --git a/lib/locale.in.h b/lib/locale.in.h
index 4aef74d4..1b11a41c 100644
--- a/lib/locale.in.h
+++ b/lib/locale.in.h
@@ -1,5 +1,5 @@
/* A POSIX <locale.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -44,6 +44,11 @@
#ifndef _@GUARD_PREFIX@_LOCALE_H
#define _@GUARD_PREFIX@_LOCALE_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h>
@@ -211,7 +216,7 @@ _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
# include "setlocale_null.h"
#endif
-#if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_NEWLOCALE@)
+#if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME_UNSAFE@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_NEWLOCALE@)
# if @REPLACE_NEWLOCALE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef newlocale
@@ -229,7 +234,7 @@ _GL_CXXALIAS_SYS (newlocale, locale_t,
(int category_mask, const char *name, locale_t base));
# endif
# endif
-# if @HAVE_NEWLOCALE@
+# if __GLIBC__ >= 2 && @HAVE_NEWLOCALE@
_GL_CXXALIASWARN (newlocale);
# endif
# if @HAVE_NEWLOCALE@ || @REPLACE_NEWLOCALE@
@@ -244,24 +249,24 @@ _GL_WARN_ON_USE (newlocale, "newlocale is not portable");
# endif
#endif
-#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_DUPLOCALE@)
-# if @REPLACE_DUPLOCALE@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef duplocale
-# define duplocale rpl_duplocale
-# define GNULIB_defined_duplocale 1
-# endif
+#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME_UNSAFE@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_DUPLOCALE@)
+# if @HAVE_DUPLOCALE@ /* locale_t may be undefined if !@HAVE_DUPLOCALE@. */
+# if @REPLACE_DUPLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef duplocale
+# define duplocale rpl_duplocale
+# define GNULIB_defined_duplocale 1
+# endif
_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
-# else
-# if @HAVE_DUPLOCALE@
+# else
_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
# endif
# endif
-# if @HAVE_DUPLOCALE@
+# if __GLIBC__ >= 2 && @HAVE_DUPLOCALE@
_GL_CXXALIASWARN (duplocale);
# endif
-# if @HAVE_DUPLOCALE@ || @REPLACE_DUPLOCALE@
+# if @HAVE_DUPLOCALE@
# ifndef HAVE_WORKING_DUPLOCALE
# define HAVE_WORKING_DUPLOCALE 1
# endif
@@ -274,7 +279,7 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
# endif
#endif
-#if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_FREELOCALE@)
+#if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME_UNSAFE@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_FREELOCALE@)
# if @REPLACE_FREELOCALE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef freelocale
@@ -290,7 +295,7 @@ _GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
_GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale));
# endif
# endif
-# if @HAVE_FREELOCALE@
+# if __GLIBC__ >= 2 && @HAVE_FREELOCALE@
_GL_CXXALIASWARN (freelocale);
# endif
#elif defined GNULIB_POSIXCHECK