added #define __STDC_LIMIT_MACROS 1 for c++ compatibility with stdint.h