/*
This file contains definitions used by the Hex-Rays decompiler output.
It has type definitions and convenience macros to make the
output more readable.
Copyright (c) 2007-2017 Hex-Rays
*/#ifndefHEXRAYS_DEFS_H#defineHEXRAYS_DEFS_H#ifdefined(__GNUC__)typedeflonglong ll;typedefunsignedlonglong ull;#define__int64longlong#define__int32int#define__int16short#define__int8char#defineMAKELL(num) num ##LL#defineFMT_64"ll"#elifdefined(_MSC_VER)typedef __int64 ll;typedefunsigned __int64 ull;#defineMAKELL(num) num ##i64#defineFMT_64"I64"#elifdefined(__BORLANDC__)typedef __int64 ll;typedefunsigned __int64 ull;#defineMAKELL(num) num ##i64#defineFMT_64"L"#else#error"unknown compiler"#endiftypedefunsignedint uint;typedefunsignedchar uchar;typedefunsignedshort ushort;typedefunsignedlong ulong;typedefchar int8;typedefsignedchar sint8;typedefunsignedchar uint8;typedefshort int16;typedefsignedshort sint16;typedefunsignedshort uint16;typedefint int32;typedefsignedint sint32;typedefunsignedint uint32;typedef ll int64;typedef ll sint64;typedef ull uint64;// Partially defined types. They are used when the decompiler does not know// anything about the type except its size.#define_BYTEuint8#define_WORDuint16#define_DWORDuint32#define_QWORDuint64#if!defined(_MSC_VER)#define_LONGLONG__int128#endif// Non-standard boolean types. They are used when the decompiler can not use// the standard "bool" type because of the size mistmatch but the possible// values are only 0 and 1. See also 'BOOL' type below.typedef int8 _BOOL1;typedef int16 _BOOL2;typedef int32 _BOOL4;#ifndef_WINDOWS_typedef int8 BYTE;typedef int16 WORD;typedef int32 DWORD;typedef int32 LONG;typedefint BOOL;// uppercase BOOL is usually 4 bytes#endiftypedef int64 QWORD;#ifndef__cplusplustypedefintbool;// we want to use bool in our C programs#endif#define__pure// pure function: always returns the same value, has no// side effects// Non-returning function#ifdefined(__GNUC__)#define__noreturn__attribute__((noreturn))#else#define__noreturn__declspec(noreturn)#endif#ifndefNULL#defineNULL0#endif// Some convenience macros to make partial accesses nicer#defineLAST_IND(x,part_type)(sizeof(x)/sizeof(part_type)-1)#ifdefined(__BYTE_ORDER)&& __BYTE_ORDER == __BIG_ENDIAN#defineLOW_IND(x,part_type)LAST_IND(x,part_type)#defineHIGH_IND(x,part_type)0#else#defineHIGH_IND(x,part_type)LAST_IND(x,part_type)#defineLOW_IND(x,part_type)0#endif// first unsigned macros:#defineBYTEn(x, n)(*((_BYTE*)&(x)+n))#defineWORDn(x, n)(*((_WORD*)&(x)+n))#defineDWORDn(x, n)(*((_DWORD*)&(x)+n))#defineLOBYTE(x)BYTEn(x,LOW_IND(x,_BYTE))