[PATCH] Proper arm defines.

Riku Voipio riku.voipio at iki.fi
Mon Aug 27 14:26:11 UTC 2007


Forced packing is only needed on oldabi arm
Set middle-endian floats only for little-endian oldabi arm
set big-endian define for future bigendian arm porters.

Untested, as arm builds take 24h. But it looks good and clean :P

---
 JavaScriptCore/kjs/ustring.h        |    2 +-
 JavaScriptCore/wtf/Platform.h       |    7 +++++++
 WebCore/platform/DeprecatedString.h |    2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/JavaScriptCore/kjs/ustring.h b/JavaScriptCore/kjs/ustring.h
index fbfd638..432ac99 100644
--- a/JavaScriptCore/kjs/ustring.h
+++ b/JavaScriptCore/kjs/ustring.h
@@ -34,7 +34,7 @@
 
 /* On ARM some versions of GCC don't pack structures by default so sizeof(UChar)
    will end up being != 2 which causes crashes since the code depends on that. */
-#if COMPILER(GCC) && PLATFORM(ARM)
+#if COMPILER(GCC) && PLATFORM(FORCE_PACK)
 #define PACK_STRUCT __attribute__((packed))
 #else
 #define PACK_STRUCT
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index 533230e..dca8351 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -130,8 +130,15 @@
 #if   defined(arm) \
    || defined(__arm__)
 #define WTF_PLATFORM_ARM 1
+#if defined(__ARMEB__)
+#define WTF_PLATFORM_BIG_ENDIAN 1
+#elif !defined(__ARM_EABI__) && !defined(__ARMEB__)
 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
 #endif
+#if !defined(__ARM_EABI__)
+#define WTF_PLATFORM_FORCE_PACK 1
+#endif
+#endif
 
 /* PLATFORM(X86) */
 #if   defined(__i386__) \
diff --git a/WebCore/platform/DeprecatedString.h b/WebCore/platform/DeprecatedString.h
index c9ee76c..f438354 100644
--- a/WebCore/platform/DeprecatedString.h
+++ b/WebCore/platform/DeprecatedString.h
@@ -34,7 +34,7 @@
 
 /* On ARM some versions of GCC don't pack structures by default so sizeof(DeprecatedChar)
    will end up being != 2 which causes crashes since the code depends on that. */
-#if COMPILER(GCC) && PLATFORM(ARM)
+#if COMPILER(GCC) && PLATFORM(FORCE_PACK)
 #define PACK_STRUCT __attribute__((packed))
 #else
 #define PACK_STRUCT
-- 
1.5.2.3


-- 
"rm -rf" only sounds scary if you don't have backups



More information about the Pkg-webkit-maintainers mailing list