use inttypes.h macros to determine printf format symbols if possible

This addresses a recent regression where different versions of
MinGW(-w64) had different opinions about whether to use e.g. %I64d or
%lld to print 64-bit integers on 32-bit platforms.
Merge pull request #368 from dicej/printf-formats

use inttypes.h macros to determine printf format symbols if possible