@@ -7,6 +7,8 @@ libc_hidden_proto (nl_langinfo)
extern __typeof (nl_langinfo_l) __nl_langinfo_l;
libc_hidden_proto (__nl_langinfo_l)
+extern __typeof (nl_langinfo_l) __nl_langinfo_noaltmon_l;
+libc_hidden_proto (__nl_langinfo_noaltmon_l)
#endif
#endif
@@ -66,6 +66,9 @@ libc {
wcstoll_l; wcstoul_l; wcstoull_l; wcsxfrm_l; wctype_l;
wctrans_l; nl_langinfo_l;
}
+ GLIBC_2.25 {
+ nl_langinfo; nl_langinfo_l;
+ }
GLIBC_PRIVATE {
# global variables
__collate_element_hash; __collate_element_strings;
@@ -21,13 +21,26 @@
#include <errno.h>
#include <stddef.h>
#include "localeinfo.h"
+#include <shlib-compat.h>
/* Return a string with the data for locale-dependent parameter ITEM. */
char *
-nl_langinfo (nl_item item)
+__nl_langinfo (nl_item item)
{
return __nl_langinfo_l (item, _NL_CURRENT_LOCALE);
}
-libc_hidden_def (nl_langinfo)
+versioned_symbol (libc, __nl_langinfo, nl_langinfo, GLIBC_2_25);
+libc_hidden_ver (__nl_langinfo, nl_langinfo)
+
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_25)
+char *
+attribute_compat_text_section
+__nl_langinfo_noaltmon (nl_item item)
+{
+ return __nl_langinfo_noaltmon_l (item, _NL_CURRENT_LOCALE);
+}
+compat_symbol (libc, __nl_langinfo_noaltmon, nl_langinfo, GLIBC_2_0);
+#endif
@@ -22,6 +22,7 @@
#include <stddef.h>
#include <stdlib.h>
#include "localeinfo.h"
+#include <shlib-compat.h>
/* Return a string with the data for locale-dependent parameter ITEM. */
@@ -66,4 +67,43 @@ __nl_langinfo_l (nl_item item, __locale_t l)
return (char *) data->values[index].string;
}
libc_hidden_def (__nl_langinfo_l)
-weak_alias (__nl_langinfo_l, nl_langinfo_l)
+versioned_symbol (libc, __nl_langinfo_l, nl_langinfo_l, GLIBC_2_25);
+libc_hidden_ver (__nl_langinfo_l, nl_langinfo_l)
+
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_25)
+char *
+attribute_compat_text_section
+__nl_langinfo_noaltmon_l (nl_item item, __locale_t l)
+{
+ char *result;
+
+ if ((item >= ALTMON_1 && item <= ALTMON_12)
+ || (item >= _NL_WALTMON_1 && item <= _NL_WALTMON_12))
+ /* Pretend it's a bogus index for this category: bogus item. */
+ return (char *) "";
+ else if (item >= MON_1 && item <= MON_12)
+ {
+ /* If ALTMON_... item is not empty then it contains what MON_...
+ item contained before. */
+ result = __nl_langinfo_l (item + ALTMON_1 - MON_1, l);
+ if (result != NULL && result[0] != '\0')
+ return result;
+ }
+ else if (item >= _NL_WMON_1 && item <= _NL_WMON_12)
+ {
+ /* The same for _NL_WALTMON_... and _NL_WMON_... */
+ result = __nl_langinfo_l (item + _NL_WALTMON_1 - _NL_WMON_1, l);
+ if (result != NULL && ((wchar_t *) result)[0] != L'\0')
+ return result;
+ }
+
+ /* Default result if it is not a month or an alternative month is empty. */
+ return __nl_langinfo_l (item, l);
+}
+libc_hidden_def (__nl_langinfo_noaltmon_l)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_25)
+compat_symbol (libc, __nl_langinfo_noaltmon_l, nl_langinfo_l, GLIBC_2_3);
+#endif