mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
Don't expand _itoa inline for libc.
This commit is contained in:
parent
41cbdf2a49
commit
d4c4ee1ed5
@ -34,23 +34,27 @@ extern const char _itoa_upper_digits_internal[] attribute_hidden;
|
|||||||
extern const char _itoa_lower_digits[];
|
extern const char _itoa_lower_digits[];
|
||||||
extern const char _itoa_lower_digits_internal[] attribute_hidden;
|
extern const char _itoa_lower_digits_internal[] attribute_hidden;
|
||||||
|
|
||||||
|
#ifndef NOT_IN_libc
|
||||||
|
extern char *_itoa_word (unsigned long value, char *buflim,
|
||||||
|
unsigned int base, int upper_case);
|
||||||
|
#else
|
||||||
static inline char * __attribute__ ((unused, always_inline))
|
static inline char * __attribute__ ((unused, always_inline))
|
||||||
_itoa_word (unsigned long value, char *buflim,
|
_itoa_word (unsigned long value, char *buflim,
|
||||||
unsigned int base, int upper_case)
|
unsigned int base, int upper_case)
|
||||||
{
|
{
|
||||||
const char *digits = (upper_case
|
const char *digits = (upper_case
|
||||||
#if !defined NOT_IN_libc || defined IS_IN_rtld
|
# if defined IS_IN_rtld
|
||||||
? INTUSE(_itoa_upper_digits)
|
? INTUSE(_itoa_upper_digits)
|
||||||
: INTUSE(_itoa_lower_digits)
|
: INTUSE(_itoa_lower_digits)
|
||||||
#else
|
# else
|
||||||
? _itoa_upper_digits
|
? _itoa_upper_digits
|
||||||
: _itoa_lower_digits
|
: _itoa_lower_digits
|
||||||
#endif
|
# endif
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (base)
|
switch (base)
|
||||||
{
|
{
|
||||||
#define SPECIAL(Base) \
|
# define SPECIAL(Base) \
|
||||||
case Base: \
|
case Base: \
|
||||||
do \
|
do \
|
||||||
*--buflim = digits[value % Base]; \
|
*--buflim = digits[value % Base]; \
|
||||||
@ -67,7 +71,8 @@ _itoa_word (unsigned long value, char *buflim,
|
|||||||
}
|
}
|
||||||
return buflim;
|
return buflim;
|
||||||
}
|
}
|
||||||
#undef SPECIAL
|
# undef SPECIAL
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Similar to the _itoa functions, but output starts at buf and pointer
|
/* Similar to the _itoa functions, but output starts at buf and pointer
|
||||||
after the last written character is returned. */
|
after the last written character is returned. */
|
||||||
|
Loading…
Reference in New Issue
Block a user