View | Details | Raw Unified | Return to bug 10871 | Differences between
and this patch

Collapse All | Expand All

(-)a/include/langinfo.h (+2 lines)
Lines 7-12 libc_hidden_proto (nl_langinfo) Link Here
7
7
8
extern __typeof (nl_langinfo_l) __nl_langinfo_l;
8
extern __typeof (nl_langinfo_l) __nl_langinfo_l;
9
libc_hidden_proto (__nl_langinfo_l)
9
libc_hidden_proto (__nl_langinfo_l)
10
extern __typeof (nl_langinfo_l) __nl_langinfo_noaltmon_l;
11
libc_hidden_proto (__nl_langinfo_noaltmon_l)
10
#endif
12
#endif
11
13
12
#endif
14
#endif
(-)a/locale/Versions (+3 lines)
Lines 66-71 libc { Link Here
66
    wcstoll_l; wcstoul_l; wcstoull_l; wcsxfrm_l; wctype_l;
66
    wcstoll_l; wcstoul_l; wcstoull_l; wcsxfrm_l; wctype_l;
67
    wctrans_l; nl_langinfo_l;
67
    wctrans_l; nl_langinfo_l;
68
  }
68
  }
69
  GLIBC_2.26 {
70
    nl_langinfo; nl_langinfo_l; __nl_langinfo_l;
71
  }
69
  GLIBC_PRIVATE {
72
  GLIBC_PRIVATE {
70
    # global variables
73
    # global variables
71
    __collate_element_hash; __collate_element_strings;
74
    __collate_element_hash; __collate_element_strings;
(-)a/locale/nl_langinfo.c (-2 / +15 lines)
Lines 21-33 Link Here
21
#include <errno.h>
21
#include <errno.h>
22
#include <stddef.h>
22
#include <stddef.h>
23
#include "localeinfo.h"
23
#include "localeinfo.h"
24
#include <shlib-compat.h>
24
25
25
26
26
/* Return a string with the data for locale-dependent parameter ITEM.  */
27
/* Return a string with the data for locale-dependent parameter ITEM.  */
27
28
28
char *
29
char *
29
nl_langinfo (nl_item item)
30
__nl_langinfo (nl_item item)
30
{
31
{
31
  return __nl_langinfo_l (item, _NL_CURRENT_LOCALE);
32
  return __nl_langinfo_l (item, _NL_CURRENT_LOCALE);
32
}
33
}
33
libc_hidden_def (nl_langinfo)
34
versioned_symbol (libc, __nl_langinfo, nl_langinfo, GLIBC_2_26);
35
libc_hidden_ver (__nl_langinfo, nl_langinfo)
36
37
38
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_26)
39
char *
40
attribute_compat_text_section
41
__nl_langinfo_noaltmon (nl_item item)
42
{
43
  return __nl_langinfo_noaltmon_l (item, _NL_CURRENT_LOCALE);
44
}
45
compat_symbol (libc, __nl_langinfo_noaltmon, nl_langinfo, GLIBC_2_0);
46
#endif
(-)a/locale/nl_langinfo_l.c (-4 / +46 lines)
Lines 22-33 Link Here
22
#include <stddef.h>
22
#include <stddef.h>
23
#include <stdlib.h>
23
#include <stdlib.h>
24
#include "localeinfo.h"
24
#include "localeinfo.h"
25
#include <shlib-compat.h>
25
26
26
27
27
/* Return a string with the data for locale-dependent parameter ITEM.  */
28
/* Return a string with the data for locale-dependent parameter ITEM.  */
28
29
29
char *
30
char *
30
__nl_langinfo_l (nl_item item, __locale_t l)
31
__nl_langinfo_l_internal (nl_item item, __locale_t l)
31
{
32
{
32
  int category = _NL_ITEM_CATEGORY (item);
33
  int category = _NL_ITEM_CATEGORY (item);
33
  unsigned int index = _NL_ITEM_INDEX (item);
34
  unsigned int index = _NL_ITEM_INDEX (item);
Lines 65-69 __nl_langinfo_l (nl_item item, __locale_t l) Link Here
65
  /* Return the string for the specified item.  */
66
  /* Return the string for the specified item.  */
66
  return (char *) data->values[index].string;
67
  return (char *) data->values[index].string;
67
}
68
}
68
libc_hidden_def (__nl_langinfo_l)
69
strong_alias (__nl_langinfo_l_internal, __nl_langinfo_l_internal_alias)
69
weak_alias (__nl_langinfo_l, nl_langinfo_l)
70
versioned_symbol (libc, __nl_langinfo_l_internal,
71
		  __nl_langinfo_l, GLIBC_2_26);
72
libc_hidden_ver (__nl_langinfo_l_internal, __nl_langinfo_l)
73
versioned_symbol (libc, __nl_langinfo_l_internal_alias,
74
		  nl_langinfo_l, GLIBC_2_26);
75
libc_hidden_ver (__nl_langinfo_l_internal_alias, nl_langinfo_l)
76
77
78
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_26)
79
char *
80
attribute_compat_text_section
81
__nl_langinfo_noaltmon_l (nl_item item, __locale_t l)
82
{
83
  if ((item >= ALTMON_1 && item <= ALTMON_12)
84
      || (item >= _NL_WALTMON_1 && item <= _NL_WALTMON_12))
85
    /* Pretend it's a bogus index for this category: bogus item.  */
86
    return (char *) "";
87
  else if (item >= MON_1 && item <= MON_12)
88
    {
89
      /* ALTMON_... item contains what MON_... item contained before.  */
90
      return __nl_langinfo_l (item + ALTMON_1 - MON_1, l);
91
    }
92
  else if (item >= _NL_WMON_1 && item <= _NL_WMON_12)
93
    {
94
      /* The same for _NL_WALTMON_... and _NL_WMON_...  */
95
      return __nl_langinfo_l (item + _NL_WALTMON_1 - _NL_WMON_1, l);
96
    }
97
98
  /* Default result if it is not a month.  */
99
  return __nl_langinfo_l (item, l);
100
}
101
libc_hidden_def (__nl_langinfo_noaltmon_l)
102
#endif
103
104
#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_26)
105
strong_alias (__nl_langinfo_noaltmon_l, __nl_langinfo_noaltmon_l_alias)
106
compat_symbol (libc, __nl_langinfo_noaltmon_l_alias,
107
	       __nl_langinfo_l, GLIBC_2_2);
108
#endif
109
110
#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_26)
111
compat_symbol (libc, __nl_langinfo_noaltmon_l, nl_langinfo_l, GLIBC_2_3);
112
#endif
70
- 

Return to bug 10871