[mutex] Try work around GCC cast-align error/warning

Shouldn't be needed because of the alignas(). Oh well...

Might fix https://github.com/harfbuzz/harfbuzz/issues/3283
This commit is contained in:
Behdad Esfahbod 2021-11-05 14:45:20 -07:00
parent 77eeec53a9
commit 07dc34bdaf
1 changed files with 3 additions and 0 deletions

View File

@ -97,10 +97,13 @@ struct hb_mutex_t
/* Create space for, but do not initialize m. */ /* Create space for, but do not initialize m. */
alignas(hb_mutex_impl_t) char m[sizeof (hb_mutex_impl_t)]; alignas(hb_mutex_impl_t) char m[sizeof (hb_mutex_impl_t)];
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
void init () { hb_mutex_impl_init ((hb_mutex_impl_t *) m); } void init () { hb_mutex_impl_init ((hb_mutex_impl_t *) m); }
void lock () { hb_mutex_impl_lock ((hb_mutex_impl_t *) m); } void lock () { hb_mutex_impl_lock ((hb_mutex_impl_t *) m); }
void unlock () { hb_mutex_impl_unlock ((hb_mutex_impl_t *) m); } void unlock () { hb_mutex_impl_unlock ((hb_mutex_impl_t *) m); }
void fini () { hb_mutex_impl_finish ((hb_mutex_impl_t *) m); } void fini () { hb_mutex_impl_finish ((hb_mutex_impl_t *) m); }
#pragma GCC diagnostic pop
}; };
struct hb_lock_t struct hb_lock_t