view src/mingw-w64-2-pthreads.patch @ 4472:0fdeee4cfe11

gnuplot: enable Qt terminal and set default to wxt * src/gnuplot.mk: Depend on qt5 and build with QT=1 QT_DIR=$(HOST_PREFIX)/qt QT_BIN_DIR=(BUILD_TOOLS_PREFIX)/bin, install gnuplot_qt.exe * src/gnuplot-1-fixes.patch: add to patchto allow override of QT tools and paths * installer-files/octave-firsttime.vbs: set GNUTERM=wxt * installer-files/octave.vbs: set GNUTERM=wxt * installer-files/octave.bat: set GNUTERM=wxt * installer-files/cmdshell.bat: set GNUTERM=wxt
author Mike Miller <mtmiller@octave.org>
date Wed, 06 Sep 2017 16:19:37 -0700
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__)*/