Skip to content

Commit

Permalink
Update to latest JLLs
Browse files Browse the repository at this point in the history
GAP renamed the MPtr type to GapObj, adjust
  • Loading branch information
fingolfin committed Mar 1, 2022
1 parent da0f1c0 commit 488f71c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
GAP_jll = "~400.1191.001"
GAP_lib_jll = "~400.1191.000"
GAP_pkg_juliainterface_jll = "=0.700.300"
GAP_jll = "~400.1192.000"
GAP_lib_jll = "~400.1192.000"
GAP_pkg_juliainterface_jll = "=0.700.301"
MacroTools = "0.5"
julia = "1.6"

Expand Down
8 changes: 4 additions & 4 deletions pkg/JuliaInterface/example/function_perform.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module GapFunctionPerform

import GAP_jll: MPtr
import GAP_jll: GapObj

function typed_func(a::MPtr, b::MPtr)
function typed_func(a::GapObj, b::GapObj)
return a
end

function typed_func(a::MPtr, b::Int64)
function typed_func(a::GapObj, b::Int64)
return a
end

function typed_func(a::Int64, b::MPtr)
function typed_func(a::Int64, b::GapObj)
return a
end

Expand Down
2 changes: 1 addition & 1 deletion pkg/JuliaInterface/gap/JuliaInterface.gd
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ BindGlobal("TheTypeJuliaObject", NewType( JuliaObjectFamily, IsJuliaObject ));
#! @Description
#! If the component or positional object <A>obj</A> is in this filter
#! then calling a &Julia; function with <A>obj</A> as an argument
#! will not pass <A>obj</A> as an <C>MPtr</C>,
#! will not pass <A>obj</A> as an <C>GapObj</C>,
#! but instead its <Ref Attr="JuliaPointer" Label="for IsJuliaWrapper"/>
#! value is passed, which must be a &Julia; object.
#! This admits implementing high-level wrapper objects
Expand Down
8 changes: 4 additions & 4 deletions pkg/JuliaInterface/gap/convert.gd
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@
#! <C>Rational{T} where T &lt;:&nbsp;Integer</C>,
#! </Item>
#! <Item>
#! <C>MPtr and IsInt</C> to
#! <C>GapObj and IsInt</C> to
#! <C>BigInt</C> (default),
#! <C>Rational{T} where T &lt;:&nbsp;Integer</C>,
#! </Item>
#! <Item>
#! <C>MPtr and IsRat</C> to
#! <C>GapObj and IsRat</C> to
#! <C>Rational{BigInt}</C> (default),
#! <C>Rational{T} where T &lt;:&nbsp;Integer</C>,
#! </Item>
Expand Down Expand Up @@ -291,7 +291,7 @@
#! </Row>
#! <HorLine/>
#! <Row>
#! <Item><C>Int64</C>, <C>MPtr</C>, <C>GapFFE</C>, and <C>Bool</C></Item>
#! <Item><C>Int64</C>, <C>GapObj</C>, <C>GapFFE</C>, and <C>Bool</C></Item>
#! <Item></Item>
#! <Item>automatic conversion</Item>
#! </Row>
Expand Down Expand Up @@ -527,7 +527,7 @@ DeclareCategory( "IsRandomSourceJulia", IsRandomSource );
#! There could be a &Julia; type hierarchy of wrappers, e.g.,
#! <C>GAPInt &lt;: GAPRat &lt;: GAPCyc</C>;
#! those types would wrap the corresponding &GAP; objects,
#! i.e., they would simply wrap a <C>Union{MPtr,Int64}</C>,
#! i.e., they would simply wrap a <C>Union{GapObj,Int64}</C>,
#! but perhaps provided nicer integration with the rest of &Julia;,
#! like methods for <C>gcd</C>, say, which are properly type restricted;
#! or nicer printing (w/o the <C>GAP:</C> prefix even?).
Expand Down
2 changes: 1 addition & 1 deletion src/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function regenerate_gaproot(gaproot_mutable)
gmp_include = joinpath(gmp_prefix, "include")
gap_include = joinpath(gap_prefix, "include", "gap")
gap_include2 = joinpath(gaproot_mutable) # for code doing `#include "src/compiled.h"`
sysinfo["GAP_CPPFLAGS"] = "-I$(gmp_include) -I$(gap_include) -I$(gap_include2) -DHAVE_CONFIG_H"
sysinfo["GAP_CPPFLAGS"] = "-I$(gmp_include) -I$(gap_include) -I$(gap_include2) -DUSE_JULIA_GC=1"

# set linker flags; since these are meant for use for GAP packages, add the necessary
# flags to link against libgap
Expand Down
6 changes: 4 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import GAP_jll: GapObj


"""
FFE
Expand Down Expand Up @@ -83,8 +86,7 @@ julia> GapObj(42)
ERROR: TypeError: in typeassert, expected GapObj, got a value of type Int64
```
"""
const GapObj = GAP_jll.MPtr
""" GapObj

"""
GAP.Obj
Expand Down

0 comments on commit 488f71c

Please sign in to comment.