Skip to content

Commit 5581be9

Browse files
committed
more cleanup: actual kernel name is NT not WINNT
1 parent 5d332dd commit 5581be9

File tree

7 files changed

+20
-15
lines changed

7 files changed

+20
-15
lines changed

base/deprecated.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ export
12111211
const OS_NAME =
12121212
if Sys.KERNEL === :Darwin
12131213
:OSX
1214-
elseif Sys.KERNEL === :WINNT
1214+
elseif Sys.KERNEL === :NT
12151215
:Windows
12161216
else
12171217
Sys.KERNEL

base/osutils.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ is_bsd(os::Symbol) = (os == :FreeBSD || os == :OpenBSD || os == :NetBSD || os ==
3838
Predicate for testing if the OS is a derivative of Microsoft Windows NT.
3939
See documentation :ref:`Handling Operating System Variation <man-handling-operating-system-variation>`\ .
4040
"""
41-
is_windows(os::Symbol) = (os == :Windows || os == :WINNT)
41+
is_windows(os::Symbol) = (os == :Windows || os == :NT)
4242

4343
"""
4444
is_apple([os])

src/Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@ FLAGS := \
1717
-D_GNU_SOURCE -I$(BUILDDIR) -I$(SRCDIR) \
1818
-I$(SRCDIR)/flisp -I$(SRCDIR)/support \
1919
-I$(LIBUV_INC) -I$(build_includedir) -DLIBRARY_EXPORTS \
20-
-DJL_BUILD_UNAME='"$(OS)"' \
21-
-DJL_BUILD_ARCH='"$(ARCH)"' \
2220
-I$(JULIAHOME)/deps/valgrind
2321
ifneq ($(USEMSVC), 1)
2422
FLAGS += -Wall -Wno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden -fno-common \
2523
-Wpointer-arith -Wundef
2624
override CFLAGS += -Wold-style-definition -Wstrict-prototypes -Wc++-compat
2725
endif
2826

27+
FLAGS += -DJL_BUILD_ARCH='"$(ARCH)"'
28+
ifeq ($(OS),WINNT)
29+
FLAGS += -DJL_BUILD_UNAME='"NT"'
30+
else
31+
FLAGS += -DJL_BUILD_UNAME='"$(OS)"'
32+
endif
33+
2934
SRCS := \
3035
jltypes gf typemap ast builtins module interpreter \
3136
alloc dlload sys init task array dump toplevel jl_uv jlapi signal-handling \

test/file.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let err = nothing
2626
end
2727
end
2828

29-
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
29+
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
3030
dirlink = joinpath(dir, "dirlink")
3131
symlink(subdir, dirlink)
3232
# relative link
@@ -123,7 +123,7 @@ if is_unix()
123123
@test readlink(link) == file
124124
end
125125

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

454454
# issue #10506 #10434
455455
## Tests for directories and links to directories
456-
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
456+
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
457457
function setup_dirs(tmpdir)
458458
srcdir = joinpath(tmpdir, "src")
459459
hidden_srcdir = joinpath(tmpdir, ".hidden_srcdir")
@@ -911,7 +911,7 @@ end
911911
@test_throws ArgumentError open("ba\0d", "w")
912912
@test_throws ArgumentError cp(file, "ba\0d")
913913
@test_throws ArgumentError mv(file, "ba\0d")
914-
if !is_windows() || (Sys.windows_version() >= Base.WINDOWS_VISTA_VER)
914+
if !is_windows() || (Sys.windows_version() >= Sys.WINDOWS_VISTA_VER)
915915
@test_throws ArgumentError symlink(file, "ba\0d")
916916
else
917917
@test_throws ErrorException symlink(file, "ba\0d")
@@ -933,7 +933,7 @@ cd(dirwalk) do
933933
touch(joinpath("sub_dir1", "file$i"))
934934
end
935935
touch(joinpath("sub_dir2", "file_dir2"))
936-
has_symlinks = !is_windows() || (Sys.windows_version() >= Base.WINDOWS_VISTA_VER)
936+
has_symlinks = !is_windows() || (Sys.windows_version() >= Sys.WINDOWS_VISTA_VER)
937937
follow_symlink_vec = has_symlinks ? [true, false] : [false]
938938
has_symlinks && symlink(abspath("sub_dir2"), joinpath("sub_dir1", "link"))
939939
for follow_symlinks in follow_symlink_vec
@@ -1026,7 +1026,7 @@ if !is_windows()
10261026
rm(link)
10271027
rm(rellink)
10281028
end
1029-
if !is_windows() || (Sys.windows_version() >= Base.WINDOWS_VISTA_VER)
1029+
if !is_windows() || (Sys.windows_version() >= Sys.WINDOWS_VISTA_VER)
10301030
rm(dirlink)
10311031
rm(relsubdirlink)
10321032
end

test/libdl.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
dlls = Libdl.dllist()
66
@test !isempty(dlls)
77
@test length(dlls) > 3 # at a bare minimum, probably have some version of libstdc, libgcc, libjulia, ...
8-
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
8+
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
99
for dl in dlls
1010
if isfile(dl) && (Libdl.dlopen_e(dl) != C_NULL)
1111
@test Base.samefile(Libdl.dlpath(dl), dl)

test/repl.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ccall(:jl_exit_on_sigint, Void, (Cint,), 0)
2828
# in the mix. If verification needs to be done, keep it to the bare minimum. Basically
2929
# this should make sure nothing crashes without depending on how exactly the control
3030
# characters are being used.
31-
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
31+
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
3232
stdin_write, stdout_read, stderr_read, repl = fake_repl()
3333

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

483483
# Test stream mode
484-
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
484+
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
485485
outs, ins, p = readandwrite(`$exename --startup-file=no --quiet`)
486486
write(ins,"1\nquit()\n")
487487
@test readstring(outs) == "1\n"

test/socket.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ begin
171171
close(a)
172172
close(b)
173173
end
174-
if !is_windows() || Sys.windows_version() >= Base.WINDOWS_VISTA_VER
174+
if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
175175
a = UDPSocket()
176176
b = UDPSocket()
177177
bind(a, ip"::1", UInt16(port))

0 commit comments

Comments
 (0)