Skip to content

Commit

Permalink
Update KNITRO.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Nov 3, 2024
1 parent 5f15879 commit e7419cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/KNITRO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ function __init__()
end

function knitro_version()
buffer = zeros(Cchar, 15)
@ccall libknitro.KTR_get_release(15::Cint, buffer::Ptr{Cchar})::Cint
version_string = GC.@preserve(buffer, unsafe_string(pointer(buffer)))
length = 15
release = zeros(Cchar, length)
KN_get_release(length, release)
version_string = GC.@preserve(release, unsafe_string(pointer(release)))
return VersionNumber(split(version_string, " ")[2])
end

Expand Down

0 comments on commit e7419cc

Please sign in to comment.