Skip to content

Commit

Permalink
Fix 0.6 ccall on OS X and add OS X to Travis (#131)
Browse files Browse the repository at this point in the history
* Fix 0.6 ccall on OS X and add OS X to Travis

* Remove unnecessary at-compat

* Don't use xvfb on Mac
  • Loading branch information
ararslan authored and tkelman committed Mar 16, 2017
1 parent 7ce41ea commit de1d425
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
language: julia
os:
- linux
- osx
julia:
- 0.5
- nightly
notifications:
email: false
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone(pwd()); Pkg.clone("Winston")'
- xvfb-run julia -e 'Pkg.build("Tk"); Pkg.test("Tk"; coverage=true)';
- julia -e 'Pkg.clone(pwd())'
- if [ `uname` = "Linux" ]; then
xvfb-run julia -e 'Pkg.build("Tk"); Pkg.test("Tk"; coverage=true)';
elif [ `uname` = "Darwin" ]; then
julia -e 'Pkg.build("Tk"); Pkg.test("Tk"; coverage=true)';
fi
# - xvfb-run julia -e 'Pkg.clone(pwd()); Pkg.build("Tk"); Pkg.test("Tk"; coverage=true)';
after_success:
- julia -e 'cd(Pkg.dir("Tk")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';
16 changes: 9 additions & 7 deletions src/tkwidget.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,15 @@ function reveal(c::Canvas)
end

@static if is_apple()
if @compat Sys.WORD_SIZE == 32
const CGFloat = Float32
else
const CGFloat = Float64
end
objc_msgSend{T}(id, uid, ::Type{T}=Ptr{Void}) = ccall(:objc_msgSend, T, (Ptr{Void}, Ptr{Void}),
id, ccall(:sel_getUid, Ptr{Void}, (Ptr{UInt8},), uid))
if Sys.WORD_SIZE == 32
const CGFloat = Float32
else
const CGFloat = Float64
end
function objc_msgSend{T}(id, uid, ::Type{T}=Ptr{Void})
convert(T, ccall(:objc_msgSend, Ptr{Void}, (Ptr{Void}, Ptr{Void}),
id, ccall(:sel_getUid, Ptr{Void}, (Ptr{UInt8},), uid)))
end
end

# NOTE: This has to be ported to each window environment.
Expand Down

0 comments on commit de1d425

Please sign in to comment.