Building on Windows from scratch - datediff problem found

Derek Atkins warlord at MIT.EDU
Fri Jan 24 12:08:06 EST 2014

John Ralls <jralls at> writes:

> if (sizeof(time_t) == 8)
>   return (double)((int64)time1 - (int64)time2);
> else
>   return (double)((int32)time1 - (int32)time2);

This code probably wouldn't compile cleanly.  It would complain about
casting to different sizes.  Even though theoretically the compiler
should be able to optimize the branch by noticing that it is always true
or always false, it will still complain about the unused branch.  (I
know this from personal experience).

> That could be done as a macro and inserted into one of the header
> files in each library.
> Regards,
> John Ralls


       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL:    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available

More information about the gnucash-devel mailing list