LargestIntegralType too small
I had a problem mocking a function which is returning an uint64_t. It always comes truncated to 32 bits. Then I discovered that
# if __WORDSIZE == 64 # define LargestIntegralType unsigned long int # else # define LargestIntegralType unsigned long long int # endif
which seems to be swapped.
On my machine unsigned long is 32 bits and unsigned long long is 64 bits, of course.
PS: I would suggest to just use uintmax_t directly if a C99-compliant compiler is detected and look for matching basic types for older ones.