Skip to content

Commit

Permalink
add Compat.Sys.BINDIR (#433)
Browse files Browse the repository at this point in the history
* add Compat.Sys.BINDIR

* import Sys.BINDIR into Compat.Sys on v0.7 and add tests
  • Loading branch information
rdeits authored and fredrikekre committed Dec 23, 2017
1 parent afee752 commit 747b75d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ Currently, the `@compat` macro supports the following syntaxes:
* `Complex32`, `Complex64`, and `Complex128` are now `ComplexF16`, `ComplexF32`, and
`ComplexF64`, respectively ([#24647]).

* `JULIA_HOME` is now `Sys.BINDIR`, available in the `Compat.Sys` submodule. ([#25102])

* `Associative` is now `AbstractDict` ([#25012]).

* `indices` is now `axes` ([#25057]).
Expand Down Expand Up @@ -416,4 +418,5 @@ includes this fix. Find the minimum version from there.
[#25021]: https://github.com/JuliaLang/julia/issues/25021
[#25056]: https://github.com/JuliaLang/julia/issues/25056
[#25057]: https://github.com/JuliaLang/julia/issues/25057
[#25102]: https://github.com/JuliaLang/julia/issues/25102
[#25162]: https://github.com/JuliaLang/julia/issues/25162
6 changes: 6 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,12 @@ module Sys
else
import Base.Sys: isapple, isbsd, islinux, isunix, iswindows
end

@static if VERSION < v"0.7.0-DEV.3073"
const BINDIR = JULIA_HOME
else
const BINDIR = Base.Sys.BINDIR
end
end

@static if VERSION < v"0.7.0-DEV.892"
Expand Down
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,13 @@ end
@test ComplexF32 === Complex{Float32}
@test ComplexF64 === Complex{Float64}

# 0.7.0-DEV.3073
if VERSION < v"0.7.0-DEV.3073"
@test Compat.Sys.BINDIR == JULIA_HOME
else
@test Compat.Sys.BINDIR == Sys.BINDIR
end

# 0.7.0-DEV.2915
module Test25021
using Compat
Expand Down

0 comments on commit 747b75d

Please sign in to comment.