blob: 7e26784cd91c65aa2e66722197aad1abf425a138 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
From 4cce8c7b9107053ffd1bb0d6510797dafd632151 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Sun, 12 Jan 2025 21:02:40 -0500
Subject: [PATCH] src/graph/plotfltk.c: swap PARI and FLTK includes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PARI defines a swap() macro that conflicts with the swap() function
declared in some C++ headers used by FLTK. This can lead to build
failures like
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/alloc_traits.h
:1005:46:error: macro ‘swap’ requires 2 arguments, but only 1 given
1005 | __c.get_allocator()).swap(__c);
| ^
when using the forthcoming g++-15 to build PARI. Basically this fails
because the macro is defined before the C++ headers are included. If
we swap the includes, then the macro clobbers the function, but that's
okay because PARI only expects the macro to be in scope.
---
src/graph/plotfltk.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/graph/plotfltk.c b/src/graph/plotfltk.c
index f81515d..e95275e 100644
--- a/src/graph/plotfltk.c
+++ b/src/graph/plotfltk.c
@@ -18,16 +18,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
//
// Based on plotQt by Nils-Peter Skoruppa (www.countnumber.de)
/////////////////////////////////////////////////////////////////////////////
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/fl_draw.H>
+
extern "C" {
#include "pari.h"
#include "paripriv.h"
#include "rect.h"
}
-#include <FL/Fl.H>
-#include <FL/Fl_Window.H>
-#include <FL/fl_draw.H>
-
class Plotter: public Fl_Window {
public:
--
2.47.1
|