This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Use long long in _itoa and _itowa if PREFER_LONG_LONG isdefined


It would be cleaner just to define _itoa_word to take long long and
define away _itoa in _itoa.h as for the LONG_MAX == LLONG_MAX case.

Something like this:

Change _itoa.h to define some macros:

#ifndef _ITOA_NEEDED
# define _ITOA_NEEDED		(LONG_MAX != LLONG_MAX)
#endif
#ifndef _ITOA_WORD_TYPE
# define _ITOA_WORD_TYPE	unsigned long int
#endif

Use _ITOA_WORD_TYPE in the _itoa_word declaration, and
change the #if tests to #if _ITOA_NEEDED.

Then you can just write an x32/_itoa.h:

#define _ITOA_NEEDED	0
#define _ITOA_WORD_TYPE	unsigned long long int
#include_next <_itoa.h>


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]