patch to compile on centos6, TODO align data types to stdint