view src/mingw-w64-2-pthreads.patch @ 4511:0117b5797a5c

mesa: Depend on llvm for native opengl builds.
author John W. Eaton <jwe@octave.org>
date Mon, 16 Oct 2017 18:04:56 -0400
parents b7d6a53fa46c
children
line wrap: on
line source

based on https://sourceforge.net/p/mingw-w64/mailman/message/35828127/

diff -ur mingw-w64-v5.0.2.orig/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c mingw-w64-v5.0.2/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c
--- mingw-w64-v5.0.2.orig/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c	2017-07-31 16:10:12.189758140 -0400
+++ mingw-w64-v5.0.2/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c	2017-07-31 16:16:42.332643290 -0400
@@ -120,6 +120,7 @@
 u_quad_t	__udivdi3(u_quad_t a, u_quad_t b);
 u_quad_t	__umoddi3(u_quad_t a, u_quad_t b);
 int		__ucmpdi2(u_quad_t a, u_quad_t b);
+quad_t		__divmoddi4(quad_t a, quad_t b, quad_t *rem);
 
 #endif /* !_LIBKERN_QUAD_H_ */
 
@@ -546,6 +547,31 @@
 	(void)__qdivrem(a, b, &r);
 	return (r);
 }
+
+/*
+ * Divide two signed quads.
+ * This function is new in GCC 7.
+ */
+quad_t
+__divmoddi4(a, b, rem)
+	quad_t a, b, *rem;
+{
+	u_quad_t ua, ub, uq, ur;
+	int negq, negr;
+
+	if (a < 0)
+		ua = -(u_quad_t)a, negq = 1, negr = 1;
+	else
+		ua = a, negq = 0, negr = 0;
+	if (b < 0)
+		ub = -(u_quad_t)b, negq ^= 1;
+	else
+		ub = b;
+	uq = __qdivrem(ua, ub, &ur);
+	if (rem)
+		*rem = (negr ? -ur : ur);
+	return (negq ? -uq : uq);
+}
 #else
 static int __attribute__((unused)) dummy;
 #endif /*deined (_X86_) && !defined (__x86_64__)*/