once again, how do the headers conjure up the int64_t type? it's not a keyword.
#if __WORDSIZE == 64
typedef long int int64_t;
#else
typedef long long int int64_t;
#endifYou don't want to use "long long" because that's not necessarily 64-bits. You want to use int64_t which guarantees it is 64-bits.
And then, the correct format specifier for that is PRIi64, and not "%ld" or "%lld" which will break in different platforms.