Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ Currently, the `@compat` macro supports the following syntaxes:

* `isalpha` is now `isletter` ([#27077]).

* `cfunction` is now `@cfunction` ([#26486]).

## New macros

* `@__DIR__` has been added ([#18380])
Expand Down Expand Up @@ -635,6 +637,7 @@ includes this fix. Find the minimum version from there.
[#26369]: https://github.com/JuliaLang/julia/issues/26369
[#26436]: https://github.com/JuliaLang/julia/issues/26436
[#26442]: https://github.com/JuliaLang/julia/issues/26442
[#26486]: https://github.com/JuliaLang/julia/issues/26486
[#26660]: https://github.com/JuliaLang/julia/issues/26660
[#26670]: https://github.com/JuliaLang/julia/issues/26670
[#27077]: https://github.com/JuliaLang/julia/issues/27077
8 changes: 8 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1866,6 +1866,14 @@ end
const isletter = isalpha
end

# 0.7.0-DEV.4762
@static if !isdefined(Base, Symbol("@cfunction"))
macro cfunction(f, rt, tup)
:(Base.cfunction($f, $rt, Tuple{$tup...}))
end
export @cfunction
end

include("deprecated.jl")

end # module Compat
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1714,4 +1714,11 @@ end
@test isletter('β')
@test !isletter('3')

# 0.7.0-DEV.4762
let ptr = @cfunction(+, Int, (Int, Int))
@test ptr isa Ptr{Cvoid}
@test ptr != C_NULL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also @test ccall(ptr, Int, (Int, Int), 2, 3) == 5?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@test ccall(ptr, Int, (Int, Int), 2, 3) == 5
end

nothing