Merge pull request #833 from 0xbc/fix_cstool_build_vs2012

Fix build under VS2012 (i.e. MSC_VER = 1700)
This commit is contained in:
Nguyen Anh Quynh 2016-12-21 10:59:50 +08:00 committed by GitHub
commit b7bee9fa2e
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,4 @@
/* Tang Yuhang <tyh000011112222@gmail.com> 2016 */
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>

View File

@ -90,6 +90,11 @@ typedef unsigned long long uint64_t;
#define PRIX32 "X"
#endif
#if defined(_MSC_VER) && _MSC_VER <= 1700
// redefine functions from inttypes.h used in cstool
#define strtoull _strtoui64
#endif
#define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
#define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
#define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"