Fix bug involving undefined printf format macros.

 - According to C99, the header <inttypes.h> defines the PRI**
 macros (e.g. PRIu8) only if __STDC_FORMAT_MACROS is defined
 (see C99 standard, note 184).
 - C++11 <cinttypes> defines these always.