[gtk/f16c.msvc: 32/61] Work around compiler shortcomings on macOS
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/f16c.msvc: 32/61] Work around compiler shortcomings on macOS
- Date: Mon, 12 Apr 2021 10:13:26 +0000 (UTC)
commit f6a33a927c697a3dedaa86f79dc66aab2e0b6b30
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Apr 7 22:38:47 2021 -0400
Work around compiler shortcomings on macOS
alias attributes don't work on Darwin, so
do without.
gsk/ngl/fp16.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
---
diff --git a/gsk/ngl/fp16.c b/gsk/ngl/fp16.c
index 22453ae210..e9a8c8fbce 100644
--- a/gsk/ngl/fp16.c
+++ b/gsk/ngl/fp16.c
@@ -123,7 +123,28 @@ resolve_half_to_float4 (void)
#else
+#ifdef __APPLE__
+// turns out aliases don't work on Darwin
+
+void
+float_to_half4 (const float f[4],
+ guint16 h[4])
+{
+ float_to_half4_c (f, h);
+}
+
+void
+half_to_float4 (const guint16 h[4],
+ float f[4])
+{
+ half_to_float4_c (h, f);
+}
+
+#else
+
void float_to_half4 (const float f[4], guint16 h[4]) __attribute__((alias ("float_to_half4_c")));
void half_to_float4 (const guint16 h[4], float f[4]) __attribute__((alias ("half_to_float4_c")));
+#endif
+
#endif /* GTK_HAS_F16C */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]