Skip to content

Commit 5f25d00

Browse files
committed
Use different language construct for platform specific code
1 parent 81d4b87 commit 5f25d00

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/MPI.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ module MPI
44

55
using Compat
66

7-
if @windows? true : false
8-
include("win_mpiconstants.jl")
9-
else
7+
@windows_only begin
8+
const depfile = "win_mpiconstants.jl"
9+
end
10+
11+
@unix_only begin
1012
const depfile = joinpath(dirname(@__FILE__), "..", "deps", "src", "compile-time.jl")
1113
isfile(depfile) || error("MPI not properly installed. Please run Pkg.build(\"MPI\")")
12-
include(depfile)
1314
end
1415

16+
include(depfile)
17+
1518
include("mpi-base.jl")
1619
include("cman.jl")
1720

1821
function __init__()
19-
if @windows? true : false
20-
else
22+
@unix_only begin
2123
# need to open libmpi with RTLD_GLOBAL flag for Linux, before any ccall
2224
# cannot use RTLD_DEEPBIND; this leads to segfaults at least on Ubuntu 15.10
2325
@eval const libmpi_handle =

0 commit comments

Comments
 (0)