From e89c4be8c203c684d4e433d387074d2c2a95ffe1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= <mtjm@mtjm.eu>
Date: Fri, 11 May 2012 15:18:06 +0200
Subject: [PATCH] Recognize huge unsigned long long values as integers when
cross compiling.
MIPS N32 has RLIM_INFINITY in resource.h defined as
0x7fffffffffffffffULL which doesn't fit in a 32 bit unsigned long to
which it was casted before applying this patch, so a cross build of
libraries/unix for mips64el failed.
---
CrossCodegen.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CrossCodegen.hs b/CrossCodegen.hs
index b4f648f..7fbd20a 100644
|
a
|
b
|
|
| 499 | 499 | -- Make sure the value we're trying to binary search isn't floating point. |
| 500 | 500 | checkValueIsIntegral :: ZCursor Token -> Bool -> TestMonad Bool |
| 501 | 501 | checkValueIsIntegral z@(ZCursor (Special _ _ value) _ _) nonNegative = do |
| 502 | | let intType = if nonNegative then "unsigned long" else "long" |
| | 502 | let intType = if nonNegative then "unsigned long long" else "long long" |
| 503 | 503 | testLog ("checking if " ++ value ++ " is an integer") $ do |
| 504 | 504 | success <- runCompileBooleanTest z $ "(" ++ intType ++ ")(" ++ value ++ ") == (" ++ value ++ ")" |
| 505 | 505 | testLog' $ "result: " ++ (if success then "integer" else "floating") |