44diStorm3 - Powerful disassembler for X86/AMD64
55http://ragestorm.net/distorm/
66distorm at gmail dot com
7- Copyright (C) 2003-2016 Gil Dabah
7+ Copyright (C) 2003-2018 Gil Dabah
88This library is licensed under the BSD license. See the file COPYING.
99*/
1010
@@ -13,7 +13,7 @@ This library is licensed under the BSD license. See the file COPYING.
1313#define CONFIG_H
1414
1515/* diStorm version number. */
16- #define __DISTORMV__ 0x030304
16+ #define __DISTORMV__ 0x030400
1717
1818#include <string.h> /* memset, memcpy - can be easily self implemented for libc independency. */
1919
@@ -128,34 +128,45 @@ This library is licensed under the BSD license. See the file COPYING.
128128
129129/* Define stream read functions for big endian systems. */
130130#ifdef BE_SYSTEM
131+
132+ /* Avoid defining 'static static' for GCC. */
133+ #ifndef __GNUC__
134+ #define STATIC_INLINE static _INLINE_
135+ #else
136+ #define STATIC_INLINE static
137+ #endif
138+
131139/*
132- * These functions can read from the stream safely!
140+ * Assumption: These functions can read from the stream safely!
133141 * Swap endianity of input to little endian.
134142 */
135- static _INLINE_ int16_t RSHORT (const uint8_t * s )
143+ STATIC_INLINE int16_t RSHORT (const uint8_t * s )
136144{
137145 return s [0 ] | (s [1 ] << 8 );
138146}
139- static _INLINE_ uint16_t RUSHORT (const uint8_t * s )
147+ STATIC_INLINE uint16_t RUSHORT (const uint8_t * s )
140148{
141149 return s [0 ] | (s [1 ] << 8 );
142150}
143- static _INLINE_ int32_t RLONG (const uint8_t * s )
151+ STATIC_INLINE int32_t RLONG (const uint8_t * s )
144152{
145153 return s [0 ] | (s [1 ] << 8 ) | (s [2 ] << 16 ) | (s [3 ] << 24 );
146154}
147- static _INLINE_ uint32_t RULONG (const uint8_t * s )
155+ STATIC_INLINE uint32_t RULONG (const uint8_t * s )
148156{
149157 return s [0 ] | (s [1 ] << 8 ) | (s [2 ] << 16 ) | (s [3 ] << 24 );
150158}
151- static _INLINE_ int64_t RLLONG (const uint8_t * s )
159+ STATIC_INLINE int64_t RLLONG (const uint8_t * s )
152160{
153161 return s [0 ] | (s [1 ] << 8 ) | (s [2 ] << 16 ) | (s [3 ] << 24 ) | ((uint64_t )s [4 ] << 32 ) | ((uint64_t )s [5 ] << 40 ) | ((uint64_t )s [6 ] << 48 ) | ((uint64_t )s [7 ] << 56 );
154162}
155- static _INLINE_ uint64_t RULLONG (const uint8_t * s )
163+ STATIC_INLINE uint64_t RULLONG (const uint8_t * s )
156164{
157165 return s [0 ] | (s [1 ] << 8 ) | (s [2 ] << 16 ) | (s [3 ] << 24 ) | ((uint64_t )s [4 ] << 32 ) | ((uint64_t )s [5 ] << 40 ) | ((uint64_t )s [6 ] << 48 ) | ((uint64_t )s [7 ] << 56 );
158166}
167+
168+ #undef STATIC_INLINE
169+
159170#else
160171/* Little endian macro's will just make the cast. */
161172#define RSHORT (x ) *(int16_t *)x
0 commit comments