Skip to content

Commit

Permalink
more cleanup: actual kernel name is NT not WINNT
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed May 16, 2016
1 parent 5d332dd commit 5581be9
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ export
const OS_NAME =
if Sys.KERNEL === :Darwin
:OSX
elseif Sys.KERNEL === :WINNT
elseif Sys.KERNEL === :NT
:Windows
else
Sys.KERNEL
Expand Down
2 changes: 1 addition & 1 deletion base/osutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ is_bsd(os::Symbol) = (os == :FreeBSD || os == :OpenBSD || os == :NetBSD || os ==
Predicate for testing if the OS is a derivative of Microsoft Windows NT.
See documentation :ref:`Handling Operating System Variation <man-handling-operating-system-variation>`\ .
"""
is_windows(os::Symbol) = (os == :Windows || os == :WINNT)
is_windows(os::Symbol) = (os == :Windows || os == :NT)

"""
is_apple([os])
Expand Down
9 changes: 7 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@ FLAGS := \
-D_GNU_SOURCE -I$(BUILDDIR) -I$(SRCDIR) \
-I$(SRCDIR)/flisp -I$(SRCDIR)/support \
-I$(LIBUV_INC) -I$(build_includedir) -DLIBRARY_EXPORTS \
-DJL_BUILD_UNAME='"$(OS)"' \
-DJL_BUILD_ARCH='"$(ARCH)"' \
-I$(JULIAHOME)/deps/valgrind
ifneq ($(USEMSVC), 1)
FLAGS += -Wall -Wno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden -fno-common \
-Wpointer-arith -Wundef
override CFLAGS += -Wold-style-definition -Wstrict-prototypes -Wc++-compat
endif

FLAGS += -DJL_BUILD_ARCH='"$(ARCH)"'
ifeq ($(OS),WINNT)
FLAGS += -DJL_BUILD_UNAME='"NT"'
else
FLAGS += -DJL_BUILD_UNAME='"$(OS)"'
endif

SRCS := \
jltypes gf typemap ast builtins module interpreter \
alloc dlload sys init task array dump toplevel jl_uv jlapi signal-handling \
Expand Down
12 changes: 6 additions & 6 deletions test/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let err = nothing
end
end

if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
dirlink = joinpath(dir, "dirlink")
symlink(subdir, dirlink)
# relative link
Expand Down Expand Up @@ -123,7 +123,7 @@ if is_unix()
@test readlink(link) == file
end

if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
@test islink(dirlink) == true
@test isdir(dirlink) == true
@test readlink(dirlink) == subdir * (is_windows() ? "\\" : "")
Expand Down Expand Up @@ -453,7 +453,7 @@ end

# issue #10506 #10434
## Tests for directories and links to directories
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
function setup_dirs(tmpdir)
srcdir = joinpath(tmpdir, "src")
hidden_srcdir = joinpath(tmpdir, ".hidden_srcdir")
Expand Down Expand Up @@ -911,7 +911,7 @@ end
@test_throws ArgumentError open("ba\0d", "w")
@test_throws ArgumentError cp(file, "ba\0d")
@test_throws ArgumentError mv(file, "ba\0d")
if !is_windows() || (Sys.windows_version() >= Base.WINDOWS_VISTA_VER)
if !is_windows() || (Sys.windows_version() >= Sys.WINDOWS_VISTA_VER)
@test_throws ArgumentError symlink(file, "ba\0d")
else
@test_throws ErrorException symlink(file, "ba\0d")
Expand All @@ -933,7 +933,7 @@ cd(dirwalk) do
touch(joinpath("sub_dir1", "file$i"))
end
touch(joinpath("sub_dir2", "file_dir2"))
has_symlinks = !is_windows() || (Sys.windows_version() >= Base.WINDOWS_VISTA_VER)
has_symlinks = !is_windows() || (Sys.windows_version() >= Sys.WINDOWS_VISTA_VER)
follow_symlink_vec = has_symlinks ? [true, false] : [false]
has_symlinks && symlink(abspath("sub_dir2"), joinpath("sub_dir1", "link"))
for follow_symlinks in follow_symlink_vec
Expand Down Expand Up @@ -1026,7 +1026,7 @@ if !is_windows()
rm(link)
rm(rellink)
end
if !is_windows() || (Sys.windows_version() >= Base.WINDOWS_VISTA_VER)
if !is_windows() || (Sys.windows_version() >= Sys.WINDOWS_VISTA_VER)
rm(dirlink)
rm(relsubdirlink)
end
Expand Down
2 changes: 1 addition & 1 deletion test/libdl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dlls = Libdl.dllist()
@test !isempty(dlls)
@test length(dlls) > 3 # at a bare minimum, probably have some version of libstdc, libgcc, libjulia, ...
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
for dl in dlls
if isfile(dl) && (Libdl.dlopen_e(dl) != C_NULL)
@test Base.samefile(Libdl.dlpath(dl), dl)
Expand Down
6 changes: 3 additions & 3 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ccall(:jl_exit_on_sigint, Void, (Cint,), 0)
# in the mix. If verification needs to be done, keep it to the bare minimum. Basically
# this should make sure nothing crashes without depending on how exactly the control
# characters are being used.
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
stdin_write, stdout_read, stderr_read, repl = fake_repl()

repl.specialdisplay = Base.REPL.REPLDisplay(repl)
Expand Down Expand Up @@ -398,7 +398,7 @@ begin
LineEdit.enter_search(s, custom_histp, true)
end
# Simple non-standard REPL tests
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
stdin_write, stdout_read, stdout_read, repl = fake_repl()
panel = LineEdit.Prompt("testπ";
prompt_prefix="\e[38;5;166m",
Expand Down Expand Up @@ -481,7 +481,7 @@ if !is_windows()
end

# Test stream mode
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
outs, ins, p = readandwrite(`$exename --startup-file=no --quiet`)
write(ins,"1\nquit()\n")
@test readstring(outs) == "1\n"
Expand Down
2 changes: 1 addition & 1 deletion test/socket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ begin
close(a)
close(b)
end
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
a = UDPSocket()
b = UDPSocket()
bind(a, ip"::1", UInt16(port))
Expand Down

0 comments on commit 5581be9

Please sign in to comment.