Skip to content

Commit

Permalink
Merge pull request JuliaParallel#156 from JuliaParallel/eschnett/fiel…
Browse files Browse the repository at this point in the history
…doffset

Avoid deprecated Base.fieldoffsets
  • Loading branch information
eschnett committed Jun 4, 2016
2 parents 571ec62 + 08020c4 commit 25d3570
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mpi-base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ typealias MPIDatatype Union{Char,
Float32, Float64, Complex64, Complex128}
typealias MPIBuffertype{T} Union{Ptr{T}, Array{T}, Ref{T}}

if VERSION >= v"0.5"
# TODO: Use Compat for this
fieldoffsets{T}(::Type{T}) = Int[fieldoffset(T, i) for i in 1:nfields(T)]
end

# Define a function mpitype(T) that returns the MPI datatype code for
# a given type T. In the case the the type does not exist, it is created and
# then returned. The dictonary is defined in __init__ so the module can be
Expand Down

0 comments on commit 25d3570

Please sign in to comment.