summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-11-02 16:34:59 (GMT)
committer Michael Drake <michael.drake@codethink.co.uk>2018-05-05 20:19:36 (GMT)
commit8319ead5304bb04e90dd7f473ac60e5c2a58fdeb (patch)
tree9c5f18bd24287d69ebc673589a79a4838e8ff532
parent0ee536b083e19a5f2c5c9ed2932ced17dbb5eb5b (diff)
downloadnetsurf-8319ead5304bb04e90dd7f473ac60e5c2a58fdeb.tar.gz
netsurf-8319ead5304bb04e90dd7f473ac60e5c2a58fdeb.tar.bz2
Duktape: Squash -Wcast-align warnings on armhf.
-rw-r--r--content/handlers/javascript/duktape/duktape.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/content/handlers/javascript/duktape/duktape.c b/content/handlers/javascript/duktape/duktape.c
index 633a940..dbebee2 100644
--- a/content/handlers/javascript/duktape/duktape.c
+++ b/content/handlers/javascript/duktape/duktape.c
@@ -4219,6 +4219,9 @@ DUK_INTERNAL_DECL void duk_regexp_match_force_global(duk_hthread *thr); /* hack
/* XXX: macro for shared header fields (avoids some padding issues) */
+#if (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_MSVC_PRAGMA)
+#pragma pack(push, 8)
+#endif
struct duk_heaphdr {
duk_uint32_t h_flags;
@@ -4264,7 +4267,16 @@ struct duk_heaphdr {
#if defined(DUK_USE_HEAPPTR16)
duk_uint16_t h_extra16;
#endif
-};
+}
+#if (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_GCC_ATTR)
+__attribute__ ((aligned (8)))
+#elif (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_CLANG_ATTR)
+__attribute__ ((aligned (8)))
+#endif
+;
+#if (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_MSVC_PRAGMA)
+#pragma pack(pop)
+#endif
struct duk_heaphdr_string {
/* 16 bits would be enough for shared heaphdr flags and duk_hstring
@@ -5733,6 +5745,9 @@ DUK_INTERNAL_DECL duk_double_t duk_time_get_monotonic_time(duk_hthread *thr);
* Misc
*/
+#if (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_MSVC_PRAGMA)
+#pragma pack(push, 8)
+#endif
struct duk_hstring {
/* Smaller heaphdr than for other objects, because strings are held
* in string intern table which requires no link pointers. Much of
@@ -5777,7 +5792,16 @@ struct duk_hstring {
* for strings, but fields above should guarantee alignment-by-4
* (but not alignment-by-8).
*/
-};
+}
+#if (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_GCC_ATTR)
+__attribute__ ((aligned (8)))
+#elif (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_CLANG_ATTR)
+__attribute__ ((aligned (8)))
+#endif
+;
+#if (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_MSVC_PRAGMA)
+#pragma pack(pop)
+#endif
/* The external string struct is defined even when the feature is inactive. */
struct duk_hstring_external {