From 08020c4238b8734c3a7b87a13c057a12f2cda892 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 1 Jun 2016 21:53:20 -0400 Subject: [PATCH] Avoid deprecated Base.fieldoffsets --- src/mpi-base.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mpi-base.jl b/src/mpi-base.jl index ff159a46a..81f153299 100644 --- a/src/mpi-base.jl +++ b/src/mpi-base.jl @@ -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