]> dgit.raspbian.org Git - solvespace.git/commitdiff
Include solvespace.h before spnav.h in the GTK frontend
authorAnton Gladky <gladk@debian.org>
Sat, 3 Oct 2026 17:07:41 +0000 (19:07 +0200)
committerAnton Gladky <gladk@debian.org>
Sat, 3 Oct 2026 17:07:41 +0000 (19:07 +0200)
Forwarded: no
Last-Update: 2026-10-03

spnav.h includes <X11/Xlib.h>, which does "#define Complex 0". When Eigen
is included afterwards, its AltiVec backend (used on ppc64el) fails to
compile because it uses "bool Complex" as a template parameter name.
Include solvespace.h, and therefore Eigen, before the X11 headers.

Gbp-Pq: Name 08-Include-Eigen-before-X11-headers.patch

src/platform/guigtk.cpp

index 522fb13586cba7d945d896119ece1a6608bd13e9..2e845a3aded3799dd392d926a18b0ea1070c1910 100644 (file)
 #   include <gtkmm/filechoosernative.h>
 #endif
 
+// Include solvespace.h (and thus Eigen) before spnav.h: the latter pulls in
+// <X11/Xlib.h>, which defines macros such as `Complex` that break Eigen's
+// AltiVec template code on ppc64el.
+#include "solvespace.h"
+
 #if defined(HAVE_SPACEWARE)
 #   include <spnav.h>
 #   include <gdk/gdk.h>
@@ -48,8 +53,6 @@
 #   endif
 #endif
 
-#include "solvespace.h"
-
 namespace SolveSpace {
 namespace Platform {