Sourceware Bugzilla – Attachment 9596 Details for
Bug 10871
'mon' array should contain both nominative and genitive cases
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Provide backward compatibility for nl_langinfo family (version 4)
0002-Provide-backward-compatibility-for-nl_langinfo-famil.patch (text/plain), 5.14 KB, created by
Rafal Luzynski
on 2016-10-27 23:50:29 UTC
(
hide
)
Description:
Provide backward compatibility for nl_langinfo family (version 4)
Filename:
MIME Type:
Creator:
Rafal Luzynski
Created:
2016-10-27 23:50:29 UTC
Size:
5.14 KB
patch
obsolete
>From 8228a6cea429b68fdc7ad9d6570b2d9fda1b6114 Mon Sep 17 00:00:00 2001 >From: Rafal Luzynski <digitalfreak@lingonborough.com> >Date: Sat, 8 Oct 2016 23:23:04 +0200 >Subject: [PATCH 02/11] Provide backward compatibility for nl_langinfo family > (bug 10871). > >As ALTMON_1 .. ALTMON_12 constants have been added to nl_langinfo* >family of functions backward compatibility implementation must be >provided for older binaries which assume that MON_1 .. MON_12 >return month names in their nominative case. > >[BZ #10871] >* include/langinfo.h: Declare __nl_langinfo_noaltmon_l. >* locale/Versions (libc: GLIBC_2.25): New nl_langinfo* added. >* locale/nl_langinfo.c: Provide backward compatible version. >* locale/nl_langinfo_l.c: Likewise. >--- > include/langinfo.h | 2 ++ > locale/Versions | 3 +++ > locale/nl_langinfo.c | 17 ++++++++++++++-- > locale/nl_langinfo_l.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++--- > 4 files changed, 70 insertions(+), 5 deletions(-) > >diff --git a/include/langinfo.h b/include/langinfo.h >index d60d7f6..60729e4 100644 >--- a/include/langinfo.h >+++ b/include/langinfo.h >@@ -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 >diff --git a/locale/Versions b/locale/Versions >index 7211934..6b49ddb 100644 >--- a/locale/Versions >+++ b/locale/Versions >@@ -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; __nl_langinfo_l; >+ } > GLIBC_PRIVATE { > # global variables > __collate_element_hash; __collate_element_strings; >diff --git a/locale/nl_langinfo.c b/locale/nl_langinfo.c >index d523564..9be1ccb 100644 >--- a/locale/nl_langinfo.c >+++ b/locale/nl_langinfo.c >@@ -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 >diff --git a/locale/nl_langinfo_l.c b/locale/nl_langinfo_l.c >index 0032c0b..63f3add 100644 >--- a/locale/nl_langinfo_l.c >+++ b/locale/nl_langinfo_l.c >@@ -22,12 +22,13 @@ > #include <stddef.h> > #include <stdlib.h> > #include "localeinfo.h" >+#include <shlib-compat.h> > > > /* Return a string with the data for locale-dependent parameter ITEM. */ > > char * >-__nl_langinfo_l (nl_item item, __locale_t l) >+__nl_langinfo_l_internal (nl_item item, __locale_t l) > { > int category = _NL_ITEM_CATEGORY (item); > unsigned int index = _NL_ITEM_INDEX (item); >@@ -65,5 +66,51 @@ __nl_langinfo_l (nl_item item, __locale_t l) > /* Return the string for the specified item. */ > return (char *) data->values[index].string; > } >-libc_hidden_def (__nl_langinfo_l) >-weak_alias (__nl_langinfo_l, nl_langinfo_l) >+strong_alias (__nl_langinfo_l_internal, __nl_langinfo_l_internal2) >+versioned_symbol (libc, __nl_langinfo_l_internal, __nl_langinfo_l, GLIBC_2_25); >+libc_hidden_ver (__nl_langinfo_l_internal, __nl_langinfo_l) >+versioned_symbol (libc, __nl_langinfo_l_internal2, nl_langinfo_l, GLIBC_2_25); >+libc_hidden_ver (__nl_langinfo_l_internal2, 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_2, GLIBC_2_25) >+strong_alias (__nl_langinfo_noaltmon_l, __nl_langinfo_noaltmon_l2) >+compat_symbol (libc, __nl_langinfo_noaltmon_l2, __nl_langinfo_l, GLIBC_2_2); >+#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 >-- >2.7.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10871
:
8795
|
8874
|
8875
|
8876
|
8877
|
8878
|
8879
|
8880
|
9122
|
9123
|
9124
|
9125
|
9126
|
9127
|
9569
|
9570
|
9571
|
9572
|
9573
|
9574
|
9575
|
9576
|
9577
|
9578
|
9579
|
9595
|
9596
|
9597
|
9598
|
9599
|
9709
|
9710
|
9711
|
9712
|
9713
|
9714
|
9715
|
9716
|
9717
|
9718
|
9719
|
9720
|
9721
|
9908
|
9909
|
9910
|
9911
|
9912
|
9913
|
9914
|
9915
|
9916
|
9917
|
9918
|
9919
|
10063
|
10064
|
10065
|
10225
|
10226
|
10227
|
10228
|
10229
|
10230
|
10231
|
10425
|
10426
|
10427
|
10428
|
10429
|
10430
|
10592
|
10593
|
10594
|
10595
|
10596
|
10597
|
10598
|
10599
|
10600
|
10601
|
10602
|
10731
|
10732
|
10733
|
10734
|
10735
|
10736
|
10737
|
10738
|
10739
|
10740
|
10741
|
10742