On Sat, Jan 23, 2010 at 12:13:51PM +0100, Jim Meyering wrote: > diff --git a/lib/xstrtol.h b/lib/xstrtol.h > index 95475f0..3a94a9c 100644 > --- a/lib/xstrtol.h > +++ b/lib/xstrtol.h > @@ -46,6 +46,11 @@ _DECLARE_XSTRTOL (xstrtoul, unsigned long int) > _DECLARE_XSTRTOL (xstrtoimax, intmax_t) > _DECLARE_XSTRTOL (xstrtoumax, uintmax_t) > > +#if HAVE_LONG_LONG_INT > +_DECLARE_XSTRTOL (xstrtoll, long long int) > +_DECLARE_XSTRTOL (xstrtoull, unsigned long long int) > +#endif > + > #ifndef __attribute__ > # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) > # define __attribute__(x)
This didn't work for me. I had to add '#include <config.h>' near the top of 'lib/xstrtol.h' in order to get the symbol HAVE_LONG_LONG_INT defined. Once I added that, the xstrtoll function works correctly against a variety of tests of well- and badly-formed strings. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v