X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fhelper%2Ftypes.h;h=f993ba21dc848ad20773fe71e5614e03f34daf72;hb=cd5e09303c2031b4fb91a38a7ebe24b69afc4fb1;hp=1516bc2178c39056e8431a72f4cf6d2b8d53b777;hpb=4e7ec0893969bda2ee77cb89617f909a45e8ff0f;p=openocd.git diff --git a/src/helper/types.h b/src/helper/types.h index 1516bc2178..f993ba21dc 100644 --- a/src/helper/types.h +++ b/src/helper/types.h @@ -23,13 +23,12 @@ #ifndef TYPES_H #define TYPES_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef HAVE_SYS_TYPES_H #include #endif +#ifdef HAVE_STDINT_H +#include +#endif #ifndef u8 typedef unsigned char u8; @@ -61,7 +60,7 @@ typedef struct jtag_tap_s jtag_tap_t; #define true 1 typedef int _Bool; -#else +#else typedef bool _Bool; #endif /* __cplusplus */ #endif /* HAVE__BOOL */ @@ -137,4 +136,23 @@ static inline void h_u16_to_be(u8* buf, int val) buf[1] = (u8) (val >> 0); } +#ifdef __ECOS +/* eCos plain lacks this definition... */ +typedef CYG_ADDRWORD intptr_t; +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#define INT8_MAX 0x7f +#define INT8_MIN (-INT8_MAX - 1) +#define UINT8_MAX (__CONCAT(INT8_MAX, U) * 2U + 1U) +#define INT16_MAX 0x7fff +#define INT16_MIN (-INT16_MAX - 1) +#define UINT16_MAX (__CONCAT(INT16_MAX, U) * 2U + 1U) +#define INT32_MAX 0x7fffffffL +#define INT32_MIN (-INT32_MAX - 1L) +#define UINT32_MAX (__CONCAT(INT32_MAX, U) * 2UL + 1UL) +#define INT64_MAX 0x7fffffffffffffffLL +#define INT64_MIN (-INT64_MAX - 1LL) +#define UINT64_MAX (__CONCAT(INT64_MAX, U) * 2ULL + 1ULL) +#endif + #endif /* TYPES_H */