Re: Add qword support to pciutils (Take 5)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martin Mares wrote:

> > diff --git a/lib/types.h b/lib/types.h
> > index 3e0e5c3..818872d 100644
> > --- a/lib/types.h
> > +++ b/lib/types.h
> > @@ -15,39 +15,50 @@
> >  typedef BYTE u8;
> >  typedef WORD u16;
> >  typedef DWORD u32;
> > +typedef unsigned __int64 u64;
> > +
> > +#ifdef PCI_HAVE_64BIT_ADDRESS
> > +#include <limits.h>
> > +#if ULONG_MAX > 0xffffffff
> > +#define PRIu64 "l"
> > +#else
> > +#define PRIu64 "ll"
> > +#endif
> > +#endif
>
> Does this make sense? Does anyone promise what format sequence should be
> used with __int64?

No, it doesn't. "I64u" is the correct one. 
http://code.google.com/p/msinttypes/ is a good point to start with that MSVC 
mess.

> >  #elif defined(PCI_HAVE_STDINT_H) || (defined(__STDC_VERSION__) &&
> > __STDC_VERSION__ >= 199901L) -#include <stdint.h>
> > +#include <inttypes.h>
>
> Is there any guarantee that <inttypes.h> is available? Isn't it C99 only?

It is. And MSVC is my favorite example of a compiler that still doesn't 
support it 10 years later.

Greetings,

Eike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux