Skip to content

Commit f6c5974

Browse files
wilfwilsonjames-d-mitchell
authored andcommitted
Re-establish support for GAP 4.10
* Avoid 1-argument `First`/`Last` – instead use `list[1]`/`list[Length(list)]` * Include compiled.h in GAP 4.10, since gap_all.h doesn't exist yet
1 parent 21fd4c5 commit f6c5974

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

gap/attr.gi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,12 +1814,12 @@ function(D, maxLength)
18141814
# Extends a given chordless path if possible
18151815
CCExtension := function(digraph, path, C, key, blocked)
18161816
local v, extendedPath, data;
1817-
blocked := BlockNeighbours(digraph, Last(path), blocked);
1818-
for v in OutNeighboursOfVertex(digraph, Last(path)) do
1817+
blocked := BlockNeighbours(digraph, path[Length(path)], blocked);
1818+
for v in OutNeighboursOfVertex(digraph, path[Length(path)]) do
18191819
if DigraphVertexLabel(digraph, v) > key and blocked[v] = 1
18201820
and Length(path) < maxLength then
18211821
extendedPath := Concatenation(path, [v]);
1822-
if IsDigraphEdge(digraph, v, First(path)) then
1822+
if IsDigraphEdge(digraph, v, path[1]) then
18231823
Add(C, extendedPath);
18241824
else
18251825
data := CCExtension(digraph, extendedPath, C, key, blocked);
@@ -1828,7 +1828,7 @@ function(D, maxLength)
18281828
fi;
18291829
fi;
18301830
od;
1831-
blocked := UnblockNeighbours(digraph, Last(path), blocked);
1831+
blocked := UnblockNeighbours(digraph, path[Length(path)], blocked);
18321832
return [C, blocked];
18331833
end;
18341834

makedoc.g

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ for Pkg in Concatenation(PkgInfo.Dependencies.NeededOtherPackages,
5353
od;
5454

5555
ARCHIVENAME := SplitString(PkgInfo.ArchiveURL, "/");
56-
ARCHIVENAME := Concatenation(Last(ARCHIVENAME), PkgInfo.ArchiveFormats);
56+
ARCHIVENAME := Concatenation(ARCHIVENAME[Length(ARCHIVENAME)],
57+
PkgInfo.ArchiveFormats);
5758
XMLEntities.ARCHIVENAME := ARCHIVENAME;
5859

5960
XMLEntities.DIGRAPHS := PackageEntity("Digraphs");

read.g

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ BindGlobal("DIGRAPHS_NautyAvailable",
3030

3131
Unbind(_NautyTracesInterfaceVersion);
3232

33+
# Delete this when we no longer support GAP 4.10
34+
if not CompareVersionNumbers(ReplacedString(GAPInfo.Version, "dev", ""), "4.11")
35+
and not IsBound(INTOBJ_MAX) then
36+
BindGlobal("INTOBJ_MAX", 1152921504606846975);
37+
fi;
38+
3339
ReadPackage("digraphs", "gap/utils.gi");
3440
ReadPackage("digraphs", "gap/digraph.gi");
3541
ReadPackage("digraphs", "gap/constructors.gi");

src/gap-includes.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,9 @@
2626
#endif
2727
// GAP headers
2828
#include "gap_all.h" // for Obj, Int
29+
//
30+
#ifdef GAP410_OR_OLDER
31+
#include "compiled.h" // FIXME Remove include when we don't support GAP 4.10
32+
#endif
2933

3034
#endif // DIGRAPHS_SRC_GAP_INCLUDES_H_

src/gap_all.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*******************************************************************************
2+
**
3+
*A gap_all.h GAP package Digraphs Julius Jonusas
4+
** James Mitchell
5+
** Wilf A. Wilson
6+
** Michael Young
7+
**
8+
** Copyright (C) 2014-25 - Julius Jonusas, James Mitchell, Wilf A. Wilson,
9+
** Michael Young
10+
**
11+
** This file is free software, see the digraphs/LICENSE.
12+
**
13+
*******************************************************************************/
14+
15+
#ifndef DIGRAPHS_SRC_GAP_ALL_H_
16+
#define DIGRAPHS_SRC_GAP_ALL_H_
17+
// Delete this file once we no longer support GAP 4.10.
18+
// This is a hack to get Digraphs to compile on GAP 4.10 still.
19+
#define GAP410_OR_OLDER
20+
#endif // DIGRAPHS_SRC_GAP_ALL_H_

0 commit comments

Comments
 (0)