avr.cfg: Added more defines.

This commit is contained in:
Martin Ettl 2014-06-18 05:18:48 +02:00
parent d3a71916aa
commit f0099905e9
1 changed files with 67 additions and 3 deletions

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?>
<!-- Based on http://www.nongnu.org/avr-libc/user-manual/group__avr__stdint.html -->
<def>
<!-- stdint.h -->
<!-- Integer types capable of holding object pointers -->
<podtype name="intptr_t" sign="s" size="2"/>
<podtype name="uintptr_t" sign="u" size="2"/>
@ -24,6 +25,69 @@
<!-- inttypes.h -->
<podtype name="int_farptr_t" sign="s" size="4"/>
<podtype name="uint_farptr_t" sign="u" size="4"/>
<define name="INT8_MAX" value="0x7f"/>
<define name="INT8_MIN" value="(-INT8_MAX - 1)"/>
<define name="UINT8_MAX" value="(__CONCAT(INT8_MAX, U) * 2U + 1U)"/>
<define name="INT16_MAX" value="0x7fff"/>
<define name="INT16_MIN" value="(-INT16_MAX - 1)"/>
<define name="UINT16_MAX" value="(__CONCAT(INT16_MAX, U) * 2U + 1U)"/>
<define name="INT32_MAX" value="0x7fffffffL"/>
<define name="INT32_MIN" value="(-INT32_MAX - 1L)"/>
<define name="UINT32_MAX" value="(__CONCAT(INT32_MAX, U) * 2UL + 1UL)"/>
<define name="INT64_MAX" value="0x7fffffffffffffffLL"/>
<define name="INT64_MIN" value="(-INT64_MAX - 1LL)"/>
<define name="UINT64_MAX" value="(__CONCAT(INT64_MAX, U) * 2ULL + 1ULL)"/>
<!-- Limits of minimum-width integer types -->
<define name="INT_LEAST8_MAX" value="INT8_MAX"/>
<define name="INT_LEAST8_MIN" value="INT8_MIN"/>
<define name="UINT_LEAST8_MAX" value="UINT8_MAX"/>
<define name="INT_LEAST16_MAX" value="INT16_MAX"/>
<define name="INT_LEAST16_MIN" value="INT16_MIN"/>
<define name="UINT_LEAST16_MAX" value="UINT16_MAX"/>
<define name="INT_LEAST32_MAX" value="INT32_MAX"/>
<define name="INT_LEAST32_MIN" value="INT32_MIN"/>
<define name="UINT_LEAST32_MAX" value="UINT32_MAX"/>
<define name="INT_LEAST64_MAX" value="INT64_MAX"/>
<define name="INT_LEAST64_MIN" value="INT64_MIN"/>
<define name="UINT_LEAST64_MAX" value="UINT64_MAX"/>
<!-- Limits of fastest minimum-width integer types -->
<define name="INT_FAST8_MAX" value="INT8_MAX"/>
<define name="INT_FAST8_MIN" value="INT8_MIN"/>
<define name="UINT_FAST8_MAX" value="UINT8_MAX"/>
<define name="INT_FAST16_MAX" value="INT16_MAX"/>
<define name="INT_FAST16_MIN" value="INT16_MIN"/>
<define name="UINT_FAST16_MAX" value="UINT16_MAX"/>
<define name="INT_FAST32_MAX" value="INT32_MAX"/>
<define name="INT_FAST32_MIN" value="INT32_MIN"/>
<define name="UINT_FAST32_MAX" value="UINT32_MAX"/>
<define name="INT_FAST64_MAX" value="INT64_MAX"/>
<define name="INT_FAST64_MIN" value="INT64_MIN"/>
<define name="UINT_FAST64_MAX" value="UINT64_MAX"/>
<!-- Limits of integer types capable of holding object pointers -->
<define name="INTPTR_MAX" value="INT16_MAX"/>
<define name="INTPTR_MIN" value="INT16_MIN"/>
<define name="UINTPTR_MAX" value="UINT16_MAX"/>
<!-- Limits of greatest-width integer types -->
<define name="INTMAX_MAX" value="INT64_MAX"/>
<define name="INTMAX_MIN" value="INT64_MIN"/>
<define name="UINTMAX_MAX" value="UINT64_MAX"/>
<!-- Limits of other integer types -->
<define name="PTRDIFF_MAX" value="INT16_MAX"/>
<define name="PTRDIFF_MIN" value="INT16_MIN"/>
<define name="SIG_ATOMIC_MAX" value="INT8_MAX"/>
<define name="SIG_ATOMIC_MIN" value="INT8_MIN"/>
<define name="SIZE_MAX" value="(__CONCAT(INT16_MAX, U))"/>
<!-- Macros for integer constants -->
<define name="INT8_C(value)" value="((int8_t) value)"/>
<define name="UINT8_C(value)" value="((uint8_t) __CONCAT(value, U))"/>
<define name="INT16_C(value)" value="value"/>
<define name="UINT16_C(value)" value="__CONCAT(value, U)"/>
<define name="INT32_C(value)" value="__CONCAT(value, L)"/>
<define name="UINT32_C(value)" value="__CONCAT(value, UL)"/>
<define name="INT64_C(value)" value="__CONCAT(value, LL)"/>
<define name="UINT64_C(value)" value="__CONCAT(value, ULL)"/>
<define name="INTMAX_C(value)" value="__CONCAT(value, LL)"/>
<define name="UINTMAX_C(value)" value="__CONCAT(value, ULL)"/>
<!-- FIXME: add macros for printf and scanf format specifiers,e.g. PRId8 -->
<!-- math.h -->
<define name="M_E" value="2.7182818284590452354"/>
@ -39,7 +103,7 @@
<define name="M_2_SQRTPI" value="1.12837916709551257390"/>
<define name="M_SQRT2" value="1.41421356237309504880"/>
<define name="M_SQRT1_2" value="0.70710678118654752440"/>
<define name="NAN" value="__builtin_nan(\”\”)"/>
<!--define name="NAN" value="__builtin_nan(\”\”)"/-->
<define name="powf" value="pow"/>
<define name="roundf" value="round"/>
<define name="signbitf" value="signbit"/>