From 5581be9bba2f2f08bb5ddf6a3b8fd8fb939e6899 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 16 May 2016 15:50:00 -0400 Subject: [PATCH] more cleanup: actual kernel name is NT not WINNT --- base/deprecated.jl | 2 +- base/osutils.jl | 2 +- src/Makefile | 9 +++++++-- test/file.jl | 12 ++++++------ test/libdl.jl | 2 +- test/repl.jl | 6 +++--- test/socket.jl | 2 +- 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/base/deprecated.jl b/base/deprecated.jl index f3cebcdd69e38..4331cc27c2b21 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -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 diff --git a/base/osutils.jl b/base/osutils.jl index 1af61ed2efa36..cbecb5669c4bb 100644 --- a/base/osutils.jl +++ b/base/osutils.jl @@ -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 `\ . """ -is_windows(os::Symbol) = (os == :Windows || os == :WINNT) +is_windows(os::Symbol) = (os == :Windows || os == :NT) """ is_apple([os]) diff --git a/src/Makefile b/src/Makefile index cde4eb635e249..2158fc733d48a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,8 +17,6 @@ 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 \ @@ -26,6 +24,13 @@ FLAGS += -Wall -Wno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden 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 \ diff --git a/test/file.jl b/test/file.jl index 06222ea123375..738c538566497 100644 --- a/test/file.jl +++ b/test/file.jl @@ -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 @@ -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() ? "\\" : "") @@ -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") @@ -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") @@ -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 @@ -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 diff --git a/test/libdl.jl b/test/libdl.jl index 89bdda5af3186..3a29dbbf8b125 100644 --- a/test/libdl.jl +++ b/test/libdl.jl @@ -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) diff --git a/test/repl.jl b/test/repl.jl index 5c205f0cfab53..e6b3369c75d39 100644 --- a/test/repl.jl +++ b/test/repl.jl @@ -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) @@ -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", @@ -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" diff --git a/test/socket.jl b/test/socket.jl index 4016aebd4497b..f40e7cde84c3d 100644 --- a/test/socket.jl +++ b/test/socket.jl @@ -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))