$OpenBSD: patch-include_xine_xineutils_h,v 1.1 2019/12/25 15:50:45 ajacoutot Exp $

(Attempt to) fix clang build.

Index: include/xine/xineutils.h
--- include/xine/xineutils.h.orig
+++ include/xine/xineutils.h
@@ -206,12 +206,21 @@ extern void *(* xine_fast_memcpy)(void *to, const void
 static inline void *xine_small_memcpy (void *to, const void *from, size_t len) {
   void *t2 = to;
   size_t l2 = len;
+#    if !defined(__clang__)
   __asm__ __volatile__ (
     "cld\n\trep movsb"
     : "=S" (from), "=D" (t2), "=c" (l2), "=m" (*(struct {char foo[len];} *)to)
     : "0"  (from), "1"  (t2), "2"  (l2)
     : "cc"
   );
+#    else /* clang dislikes virtual variable size struct */
+  __asm__ __volatile__ (
+      "cld\n\trep movsb"
+      : "=S" (from), "=D" (t2), "=c" (l2)
+      : "0"  (from), "1"  (t2), "2"  (l2)
+      : "cc", "memory"
+  );
+#    endif
   (void)from;
   (void)t2;
   (void)l2;
