This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Use long long in _itoa and _itowa if PREFER_LONG_LONG isdefined
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 16 Mar 2012 16:33:55 -0700 (PDT)
- Subject: Re: PATCH: Use long long in _itoa and _itowa if PREFER_LONG_LONG isdefined
- References: <20120316192214.GA322@intel.com>
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