Skip to content

Commit 4475b3d

Browse files
authored
Update deprecated syntax (#116)
1 parent 5cbcd6c commit 4475b3d

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
julia 0.6
2-
Compat 0.9.5
2+
Compat 0.28.0

src/MATLAB.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ __precompile__()
22

33
module MATLAB
44

5-
using Compat.take!
5+
using Compat.Sys: islinux, iswindows, isapple
66

77
import Base: eltype, close, size, copy, ndims, unsafe_convert
88

@@ -33,7 +33,7 @@ export MSession, MatFile,
3333
mxcall,
3434
@mput, @mget, @mat_str
3535

36-
if is_windows()
36+
if iswindows()
3737
export show_msession, hide_msession, get_msession_visiblity
3838
end
3939

@@ -156,7 +156,7 @@ function __init__()
156156
mat_get_dir[] = matfunc(:matGetDir)
157157

158158

159-
if is_windows()
159+
if iswindows()
160160
# workaround "primary message table for module 77" error
161161
# creates a dummy Engine session and keeps it open so the libraries used by all other
162162
# Engine clients are not loaded and unloaded repeatedly

src/engine.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mutable struct MSession
1919
ep = ccall(eng_open[], Ptr{Void}, (Ptr{UInt8},), default_startcmd)
2020
ep == C_NULL && throw(MEngineError("failed to open a MATLAB engine session"))
2121
# hide the MATLAB command window on Windows
22-
is_windows() && ccall(eng_set_visible[], Cint, (Ptr{Void}, Cint), ep, 0)
22+
iswindows() && ccall(eng_set_visible[], Cint, (Ptr{Void}, Cint), ep, 0)
2323

2424
buf = Vector{UInt8}(bufsize)
2525
if bufsize > 0
@@ -90,7 +90,7 @@ function close_default_msession()
9090
return nothing
9191
end
9292

93-
if is_windows()
93+
if iswindows()
9494
function show_msession(m::MSession = get_default_msession())
9595
ret = ccall(eng_set_visible[], Cint, (Ptr{Void}, Cint), m, 1)
9696
ret != 0 && throw(MEngineError("failed to show MATLAB engine session (err = $ret)"))

src/mxbase.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
function matlab_home_path()
55
matlab_home = get(ENV, "MATLAB_HOME", "")
66
if isempty(matlab_home)
7-
if is_linux()
7+
if islinux()
88
matlab_home = dirname(dirname(realpath(chomp(readstring(`which matlab`)))))
9-
elseif is_apple()
9+
elseif isapple()
1010
default_dir = "/Applications"
1111
if isdir(default_dir)
1212
dirs = readdir(default_dir)
@@ -15,7 +15,7 @@ function matlab_home_path()
1515
matlab_home = joinpath(default_dir, maximum(dirs))
1616
end
1717
end
18-
elseif is_windows()
18+
elseif iswindows()
1919
default_dir = Sys.WORD_SIZE == 32 ? "C:\\Program Files (x86)\\MATLAB" : "C:\\Program Files\\MATLAB"
2020
if isdir(default_dir)
2121
dirs = readdir(default_dir)
@@ -35,11 +35,11 @@ end
3535
function matlab_lib_path()
3636
# get path to MATLAB libraries
3737
matlab_home = matlab_home_path()
38-
matlab_lib_dir = if is_linux()
38+
matlab_lib_dir = if islinux()
3939
Sys.WORD_SIZE == 32 ? "glnx86" : "glnxa64"
40-
elseif is_apple()
40+
elseif isapple()
4141
Sys.WORD_SIZE == 32 ? "maci" : "maci64"
42-
elseif is_windows()
42+
elseif iswindows()
4343
Sys.WORD_SIZE == 32 ? "win32" : "win64"
4444
end
4545
matlab_lib_path = joinpath(matlab_home, "bin", matlab_lib_dir)
@@ -51,13 +51,13 @@ end
5151

5252
function matlab_startcmd()
5353
matlab_home = matlab_home_path()
54-
if !is_windows()
54+
if !iswindows()
5555
default_startcmd = joinpath(matlab_home, "bin", "matlab")
5656
if !isfile(default_startcmd)
5757
error("The MATLAB path is invalid. Set the MATLAB_HOME evironmental variable to the MATLAB root.")
5858
end
5959
default_startcmd = "exec $(Base.shell_escape(default_startcmd))"
60-
elseif is_windows()
60+
elseif iswindows()
6161
default_startcmd = joinpath(matlab_home, "bin", (Sys.WORD_SIZE == 32 ? "win32" : "win64"), "MATLAB.exe")
6262
if !isfile(default_startcmd)
6363
error("The MATLAB path is invalid. Set the MATLAB_HOME evironmental variable to the MATLAB root.")

0 commit comments

Comments
 (0)