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;
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 (-2 / +41 lines)
Lines 22-27 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.  */
Lines 66-69 __nl_langinfo_l (nl_item item, __locale_t l) Link Here
66
  return (char *) data->values[index].string;
67
  return (char *) data->values[index].string;
67
}
68
}
68
libc_hidden_def (__nl_langinfo_l)
69
libc_hidden_def (__nl_langinfo_l)
69
weak_alias (__nl_langinfo_l, nl_langinfo_l)
70
versioned_symbol (libc, __nl_langinfo_l, nl_langinfo_l, GLIBC_2_25);
71
libc_hidden_ver (__nl_langinfo_l, nl_langinfo_l)
72
73
74
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_25)
75
char *
76
attribute_compat_text_section
77
__nl_langinfo_noaltmon_l (nl_item item, __locale_t l)
78
{
79
  char *result;
80
81
  if ((item >= ALTMON_1 && item <= ALTMON_12)
82
      || (item >= _NL_WALTMON_1 && item <= _NL_WALTMON_12))
83
    /* Pretend it's a bogus index for this category: bogus item.  */
84
    return (char *) "";
85
  else if (item >= MON_1 && item <= MON_12)
86
    {
87
      /* If ALTMON_... item is not empty then it contains what MON_...
88
         item contained before.  */
89
      result = __nl_langinfo_l (item + ALTMON_1 - MON_1, l);
90
      if (result != NULL && result[0] != '\0')
91
	return result;
92
    }
93
  else if (item >= _NL_WMON_1 && item <= _NL_WMON_12)
94
    {
95
      /* The same for _NL_WALTMON_... and _NL_WMON_...  */
96
      result = __nl_langinfo_l (item + _NL_WALTMON_1 - _NL_WMON_1, l);
97
      if (result != NULL && ((wchar_t *) result)[0] != L'\0')
98
	return result;
99
    }
100
101
  /* Default result if it is not a month or an alternative month is empty.  */
102
  return __nl_langinfo_l (item, l);
103
}
104
libc_hidden_def (__nl_langinfo_noaltmon_l)
105
#endif
106
107
#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_25)
108
compat_symbol (libc, __nl_langinfo_noaltmon_l, nl_langinfo_l, GLIBC_2_3);
109
#endif
70
- 

Return to bug 10871