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.25 {
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_25);
35
libc_hidden_ver (__nl_langinfo, nl_langinfo)
36
37
38
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_25)
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 / +50 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_internal2)
69
weak_alias (__nl_langinfo_l, nl_langinfo_l)
70
versioned_symbol (libc, __nl_langinfo_l_internal, __nl_langinfo_l, GLIBC_2_25);
71
libc_hidden_ver (__nl_langinfo_l_internal, __nl_langinfo_l)
72
versioned_symbol (libc, __nl_langinfo_l_internal2, nl_langinfo_l, GLIBC_2_25);
73
libc_hidden_ver (__nl_langinfo_l_internal2, nl_langinfo_l)
74
75
76
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_25)
77
char *
78
attribute_compat_text_section
79
__nl_langinfo_noaltmon_l (nl_item item, __locale_t l)
80
{
81
  char *result;
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
      /* If ALTMON_... item is not empty then it contains what MON_...
90
         item contained before.  */
91
      result = __nl_langinfo_l (item + ALTMON_1 - MON_1, l);
92
      if (result != NULL && result[0] != '\0')
93
	return result;
94
    }
95
  else if (item >= _NL_WMON_1 && item <= _NL_WMON_12)
96
    {
97
      /* The same for _NL_WALTMON_... and _NL_WMON_...  */
98
      result = __nl_langinfo_l (item + _NL_WALTMON_1 - _NL_WMON_1, l);
99
      if (result != NULL && ((wchar_t *) result)[0] != L'\0')
100
	return result;
101
    }
102
103
  /* Default result if it is not a month or an alternative month is empty.  */
104
  return __nl_langinfo_l (item, l);
105
}
106
libc_hidden_def (__nl_langinfo_noaltmon_l)
107
#endif
108
109
#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_25)
110
strong_alias (__nl_langinfo_noaltmon_l, __nl_langinfo_noaltmon_l2)
111
compat_symbol (libc, __nl_langinfo_noaltmon_l2, __nl_langinfo_l, GLIBC_2_2);
112
#endif
113
114
#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_25)
115
compat_symbol (libc, __nl_langinfo_noaltmon_l, nl_langinfo_l, GLIBC_2_3);
116
#endif
70
- 

Return to bug 10871