> On 24/07/2015, at 12:34 am, Miroslav Lichvar <[email protected]> wrote:
> 
> On Fri, Jul 24, 2015 at 12:05:20AM +1200, Bryan Christianson wrote:
>>> On 23/07/2015, at 11:59 pm, Miroslav Lichvar <[email protected]> wrote:
>>> Does Mac OS X have 32-bit time_t and 64-bit long? Or it's the other
>>> way around?
>> 
>> 64 bit long, 32 bit time_t.
> 
> That's an unusual combination. I've seen time_t longer than long, but
> not shorter. I hope they know about year 2038 :).

from the headers

#ifndef _STRUCT_TIMEVAL
#define _STRUCT_TIMEVAL         struct timeval
_STRUCT_TIMEVAL
{
        __darwin_time_t         tv_sec;         /* seconds */
        __darwin_suseconds_t    tv_usec;        /* and microseconds */
};
#endif /* _STRUCT_TIMEVAL */

and then

typedef long                    __darwin_time_t;        /* time() */

typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */

So there is no 2038 issue and 1.0e6 microseconds will always fit into an int32. 
Weird that the struct timeval is no longer symmetrical tho. I hadn't actually 
noticed that before.

Casting tv_usec values to int will work on a Mac and suppress the warnings. 
Does any supported OS have int < 32 bits ? 

Bryan
--
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].

Reply via email to