Faust.jl
fails to compile with Julia v1.7.2 (tested on macOS):
using Faust
[ Info: Precompiling Faust [b0df9959-3f7b-4e37-9fbf-63cb195e8303]
ERROR: LoadError: TypeError: in cfunction method definition, expected Type, got a value of type TypeVar
Stacktrace:
[1] top-level scope
@ ~/.julia/packages/Faust/V3cmO/src/uiglue.jl:78
[2] include(mod::Module, _path::String)
With this code:
function initGlue!(uglue::UIGlue{T}) where {T}
function _openTabBox(ui, label)::Cvoid
pushLabel!(uglue.pathBuilder, unsafe_string(label))
nothing
end
openTabBox = @cfunction($_openTabBox, Cvoid, (Ptr{Cvoid}, Cstring))
function _openHorizontalBox(ui, label)::Cvoid
pushLabel!(uglue.pathBuilder, unsafe_string(label))
nothing
end
openHorizontalBox = @cfunction($_openHorizontalBox, Cvoid, (Ptr{Cvoid}, Cstring))
function _openVerticalBox(ui, label)::Cvoid
pushLabel!(uglue.pathBuilder, unsafe_string(label))
nothing
end
openVerticalBox = @cfunction($_openVerticalBox, Cvoid, (Ptr{Cvoid}, Cstring))
function _closeBox(ui)::Cvoid
popLabel!(uglue.pathBuilder)
nothing
end
closeBox = @cfunction($_closeBox, Cvoid, (Ptr{Cvoid},))
function _addButton(ui, label, zone)::Cvoid
path = buildPath(uglue.pathBuilder, unsafe_string(label))
uglue.paths[path] = zone
nothing
end
addButton = @cfunction(
$_addButton,
Cvoid, (Ptr{Cvoid}, Cstring, Ptr{T}))
function _addCheckButton(ui, label, zone)::Cvoid
path = buildPath(uglue.pathBuilder, unsafe_string(label))
uglue.paths[path] = zone
nothing
end
addCheckButton = @cfunction(
$_addCheckButton,
Cvoid, (Ptr{Cvoid}, Cstring, Ptr{T}))
function _addVerticalSlider(ui, label, zone, init, fmin, fmax, step)::Cvoid
path = buildPath(uglue.pathBuilder, unsafe_string(label))
uglue.paths[path] = zone
uglue.ranges[path] = UIRange(init, fmin, fmax, step)
nothing
end
addVerticalSlider = @cfunction(
$_addVerticalSlider,
Cvoid, (Ptr{Cvoid}, Cstring, Ptr{T}, T, T, T, T))
function _addHorizontalSlider(ui, label, zone, init, fmin, fmax, step)::Cvoid
path = buildPath(uglue.pathBuilder, unsafe_string(label))
uglue.paths[path] = zone
uglue.ranges[path] = UIRange(init, fmin, fmax, step)
nothing
end
addHorizontalSlider = @cfunction(
$_addHorizontalSlider,
Cvoid, (Ptr{Cvoid}, Cstring, Ptr{T}, T, T, T, T))
function _addNumEntry(ui, label, zone, init, fmin, fmax, step)::Cvoid
path = buildPath(uglue.pathBuilder, unsafe_string(label))
uglue.paths[path] = zone
uglue.ranges[path] = UIRange(init, fmin, fmax, step)
nothing
end
addNumEntry = @cfunction(
$_addNumEntry,
Cvoid, (Ptr{Cvoid}, Cstring, Ptr{T}, T, T, T, T))
function _addHorizontalBargraph(ui, label, zone, fmin, fmax)::Cvoid
path = buildPath(uglue.pathBuilder, unsafe_string(label))
uglue.paths[path] = zone
nothing
end
addHorizontalBargraph = @cfunction(
$_addHorizontalBargraph,
Cvoid, (Ptr{Cvoid}, Cstring, Ptr{T}, T, T))
function _addVerticalBargraph(ui, label, zone, fmin, fmax)::Cvoid
path = buildPath(uglue.pathBuilder, unsafe_string(label))
uglue.paths[path] = zone
nothing
end
addVerticalBargraph = @cfunction(
$_addVerticalBargraph,
Cvoid, (Ptr{Cvoid}, Cstring, Ptr{T}, T, T))
function _declare(ui, zone, key, value)::Cvoid
nothing
end
declare = @cfunction(
$_declare,
Cvoid, (Ptr{Cvoid}, Ptr{T}, Cstring, Cstring))
# // -- soundfiles
# typedef void (* addSoundfileFun) (void* ui_interface, const char* label, const char* url, struct Soundfile** sf_zone);
uglue.gluefns = GlueFns(
openTabBox,
openHorizontalBox,
openVerticalBox,
closeBox,
addButton,
addCheckButton,
addVerticalSlider,
addHorizontalSlider,
addNumEntry,
addHorizontalBargraph,
addVerticalBargraph,
declare,
)
uglue.openTabBox = uglue.gluefns.openTabBox.ptr
uglue.openHorizontalBox = uglue.gluefns.openHorizontalBox.ptr
uglue.openVerticalBox = uglue.gluefns.openVerticalBox.ptr
uglue.closeBox = uglue.gluefns.closeBox.ptr
uglue.addButton = uglue.gluefns.addButton.ptr
uglue.addCheckButton = uglue.gluefns.addCheckButton.ptr
uglue.addVerticalSlider = uglue.gluefns.addVerticalSlider.ptr
uglue.addHorizontalSlider = uglue.gluefns.addHorizontalSlider.ptr
uglue.addNumEntry = uglue.gluefns.addNumEntry.ptr
uglue.addHorizontalBargraph = uglue.gluefns.addHorizontalBargraph.ptr
uglue.addVerticalBargraph = uglue.gluefns.addVerticalBargraph.ptr
uglue.declare = uglue.gluefns.declare.ptr
uglue
end
Any idea how to fix that ?