X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fhelper%2Ftypes.h;h=f993ba21dc848ad20773fe71e5614e03f34daf72;hb=cd5e09303c2031b4fb91a38a7ebe24b69afc4fb1;hp=8ee41105f1651be3efb5e2fb7213a8accbc28c0f;hpb=61cba7e0e6dae78ff257bef546e6783c4b634ad4;p=fw%2Fopenocd diff --git a/src/helper/types.h b/src/helper/types.h index 8ee41105f..f993ba21d 100644 --- a/src/helper/types.h +++ b/src/helper/types.h @@ -26,6 +26,9 @@ #ifdef HAVE_SYS_TYPES_H #include #endif +#ifdef HAVE_STDINT_H +#include +#endif #ifndef u8 typedef unsigned char u8; @@ -57,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 */ @@ -133,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 */