Skip to content

Commit 694413a

Browse files
committedMay 21, 2016
implement @static macro for replacing osutils macros
implements JuliaLang#5892 closes JuliaLang#6674 and JuliaLang#4233 Sys.KERNEL now replaces OS_NAME and unambiguously returns the name of the kernel reported by uname for the build system configuration
1 parent cac984e commit 694413a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1003
-804
lines changed
 

‎NEWS.md

+6
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ Library improvements
165165
* The `libjulia` library is now properly versioned and installed to the public `<prefix>/lib`
166166
directory, instead of the private `<prefix>/lib/julia` directory.
167167

168+
* System reflection is now more consistently exposed from Sys and not Base.
169+
`OS_NAME` has been replaced by `Sys.KERNEL` and always reports the name of the kernel (as reported by `uname`).
170+
The `@windows_only` and `@osx` family of macros have been replaced with functions such as `is_windows()` and
171+
or `is_apple()`. There's now also an `@static` macro that will evaluate the condition of an if-statement at
172+
compile time, for when a static branch is required.
173+
168174
Deprecated or removed
169175
---------------------
170176

‎base/LineEdit.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function refresh_multi_line(termbuf::TerminalBuffer, terminal::UnixTerminal, buf
204204
write_prompt(termbuf, prompt)
205205
prompt = prompt_string(prompt)
206206
# Count the '\n' at the end of the line if the terminal emulator does (specific to DOS cmd prompt)
207-
miscountnl = @windows ? (isa(Terminals.pipe_reader(terminal), Base.TTY) && !Base.ispty(Terminals.pipe_reader(terminal))) : false
207+
miscountnl = @static is_windows() ? (isa(Terminals.pipe_reader(terminal), Base.TTY) && !Base.ispty(Terminals.pipe_reader(terminal))) : false
208208
lindent = strwidth(prompt)
209209

210210
# Now go through the buffer line by line
@@ -1564,7 +1564,7 @@ function run_interface(terminal, m::ModalInterface)
15641564
p = s.current_mode
15651565
buf, ok, suspend = prompt!(terminal, m, s)
15661566
while suspend
1567-
@unix_only ccall(:jl_repl_raise_sigtstp, Cint, ())
1567+
@static if is_unix(); ccall(:jl_repl_raise_sigtstp, Cint, ()); end
15681568
buf, ok, suspend = prompt!(terminal, m, s)
15691569
end
15701570
mode(state(s, s.current_mode)).on_done(s, buf, ok)
@@ -1604,7 +1604,7 @@ function prompt!(term, prompt, s = init_state(term, prompt))
16041604
elseif state == :done
16051605
return buffer(s), true, false
16061606
elseif state == :suspend
1607-
@unix_only begin
1607+
if is_unix()
16081608
return buffer(s), true, true
16091609
end
16101610
else

0 commit comments

Comments
 (0)
Please sign in to comment.