}
/* Long on the destination platform */
+#ifdef __x86_64__
+typedef unsigned int ulong_t;
+typedef int long_t;
+#else
typedef unsigned long ulong_t;
typedef long long_t;
+#endif
struct file_state {
struct file_state *prev;
* type-> holds the number of elements.
*/
+#ifdef __x86_64__
+#define ELEMENT_COUNT_UNSPECIFIED (~0U)
+#else
#define ELEMENT_COUNT_UNSPECIFIED (~0UL)
+#endif
struct type {
unsigned int type;
meat(state, index, TOK_LIT_INT);
errno = 0;
val = strtol(state->token[index].val.str, &end, 0);
+#ifdef __x86_64__
+ if (((val == INT_MIN) || (val == INT_MAX)) &&
+ (errno == ERANGE)) {
+#else
if (((val == LONG_MIN) || (val == LONG_MAX)) &&
(errno == ERANGE)) {
+#endif
error(state, 0, "Integer constant to large");
}
break;
errno = 0;
decimal = (tk->val.str[0] != '0');
val = strtoul(tk->val.str, &end, 0);
+#ifdef __x86_64__
+ if ((val == UINT_MAX) && (errno == ERANGE)) {
+#else
if ((val == ULONG_MAX) && (errno == ERANGE)) {
+#endif
error(state, 0, "Integer constant to large");
}
u = l = 0;
}
else if (l) {
type = &long_type;
+#ifdef __x86_64__
+ if (!decimal && (val > INT_MAX)) {
+#else
if (!decimal && (val > LONG_MAX)) {
+#endif
type = &ulong_type;
}
}
if (!decimal && (val > INT_MAX) && (val <= UINT_MAX)) {
type = &uint_type;
}
+#ifdef __x86_64__
+ else if (!decimal && (val > INT_MAX)) {
+#else
else if (!decimal && (val > LONG_MAX)) {
+#endif
type = &ulong_type;
}
else if (val > INT_MAX) {