summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-04-07 22:38:47 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-04-07 22:38:47 -0400
commit2d7169fd5f2467e6a6159978fcbd89478de85424 (patch)
tree26c5e64197675d301201c548db7c28567dd04347
parent885a6b8ebc2acc7915c7fc7d8fe814c1d20d8aaf (diff)
downloadgtk+-2d7169fd5f2467e6a6159978fcbd89478de85424.tar.gz
Work around compiler shortcomings on macOShalf-float
alias attributes don't work on Darwin, so do without.
-rw-r--r--gsk/ngl/fp16.c21
1 files changed, 21 insertions, 0 deletions
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 */