2 Copyright (C) 2017-2018 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, see <https://www.gnu.org/licenses/>. */
27 /* This override can only support a limited number of arguments. */
28 #define MAX_ARG_WORDS 16
31 rpl_strfmon_l (char *s
, size_t maxsize
, locale_t locale
, const char *format
, ...)
33 /* Work around glibc 2.23 bug
34 <https://sourceware.org/bugzilla/show_bug.cgi?id=19633>. */
36 double args
[MAX_ARG_WORDS
];
41 orig_locale
= uselocale ((locale_t
)0);
43 if (uselocale (locale
) == (locale_t
)0)
47 va_start (argptr
, format
);
48 /* Hack: Consume more arguments than those that are actually given. */
49 for (i
= 0; i
< MAX_ARG_WORDS
; i
++)
50 args
[i
] = va_arg (argptr
, double);
52 result
= strfmon_l (s
, maxsize
, locale
, format
,
53 args
[0], args
[1], args
[2], args
[3], args
[4], args
[5],
54 args
[6], args
[7], args
[8], args
[9], args
[10], args
[11],
55 args
[12], args
[13], args
[14], args
[15]);
59 if (uselocale (orig_locale
) == (locale_t
)0)