-----Original Message----- From: Alexandre Julliard [mailto:julliard@winehq.com] Sent: 09 September 2003 03:13 To: Robert Shearman Cc: wine-devel@winehq.com Subject: Re: Using limits.h
"Robert Shearman" R.J.Shearman@warwick.ac.uk writes:
I'm trying to use the default limits.h installed on my Debian
Woody system,
so that I can use either LLONG_MAX or LONG_LONG_MAX in Wine. Does anyone know of anything special I have to define so that these are
defined? I have
tried __USE_ISOC99, but no joy.
If you have to do some special magic to get them, it's a clear sign that these symbols are not portable and should not be used.
Should I just use the constant that LONG_LONG_MAX equates to and put this into the source file then? Is this portable (i.e. is long long 64bits on all platforms) ?
On another note, how would you feel to adding a new debugging function (say debugstr_lld) to print out the decimal value of long longs?
Rob
"Robert Shearman" R.J.Shearman@warwick.ac.uk writes:
Should I just use the constant that LONG_LONG_MAX equates to and put this into the source file then? Is this portable (i.e. is long long 64bits on all platforms) ?
Well, long long itself is not very portable, and long long constants definitely aren't. What do you need this for?
On another note, how would you feel to adding a new debugging function (say debugstr_lld) to print out the decimal value of long longs?
We could do something like that yes.
-----Original Message----- From: Alexandre Julliard [mailto:julliard@winehq.com] Sent: 09 September 2003 17:36 To: Robert Shearman Cc: wine-devel@winehq.com Subject: Re: Using limits.h
Well, long long itself is not very portable, and long long constants definitely aren't. What do you need this for?
I am using it for invalid values for time properties in DirectShow. I thought LONG_LONG_MAX would be the easiest way to indicate that the time is invalid and hence has not been set yet, without making it a pointer and without having to use an additional flag.
I think I will end up using a variation of David's solution.
Rob
Should I just use the constant that LONG_LONG_MAX equates to and put this into the source file then? Is this portable (i.e. is long long 64bits on all platforms) ?
#define LONG_LONG_MAX (~0ull)
David
David Laight david@l8s.co.uk writes:
#define LONG_LONG_MAX (~0ull)
That's ULONG_LONG_MAX, not LONG_LONG_MAX. And note that the 'll' suffix is not portable.