Skip to content

Commit

Permalink
Merge branch 'master' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Jun 8, 2015
2 parents 33bf2d1 + dfe0eed commit dcc54ca
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 273 deletions.
44 changes: 0 additions & 44 deletions msvc/headers/inttypes.h

This file was deleted.

68 changes: 62 additions & 6 deletions myinttypes.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,65 @@
/* Capstone Disassembly Engine */
/* By Axel Souchet, 2014 */

#ifndef CS_MYINTTYPES_H
#define CS_MYINTTYPES_H

#if defined(CAPSTONE_HAS_OSXKERNEL) || (defined(_MSC_VER) && _MSC_VER <= 1700)
// this system does not have inttypes.h

#if defined(_MSC_VER) && _MSC_VER <= 1700
#include "msvc/headers/inttypes.h"
#elif defined(CAPSTONE_HAS_OSXKERNEL)
/* this is a trimmed copy of system inttypes.h that doesn't exist
in OSX kernel framework headers */
#include "osxkernel_inttypes.h"
#else
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#endif

#define __PRI_8_LENGTH_MODIFIER__ "hh"
#define __PRI_64_LENGTH_MODIFIER__ "ll"

#define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
#define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
#define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
#define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
#define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
#define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"

#define PRId16 "hd"
#define PRIi16 "hi"
#define PRIo16 "ho"
#define PRIu16 "hu"
#define PRIx16 "hx"
#define PRIX16 "hX"

#if defined(_MSC_VER) && _MSC_VER <= 1700
#define PRId32 "ld"
#define PRIi32 "li"
#define PRIo32 "lo"
#define PRIu32 "lu"
#define PRIx32 "lx"
#define PRIX32 "lX"
#else // OSX
#define PRId32 "d"
#define PRIi32 "i"
#define PRIo32 "o"
#define PRIu32 "u"
#define PRIx32 "x"
#define PRIX32 "X"
#endif

#define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
#define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
#define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
#define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
#define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
#define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"

#else // this system has inttypes.h by default
#include <inttypes.h>
#endif

#endif
223 changes: 0 additions & 223 deletions osxkernel_inttypes.h

This file was deleted.

0 comments on commit dcc54ca

Please sign in to comment.