Skip to content

Commit

Permalink
Fix 1.9/1.10 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Jun 6, 2024
1 parent b94ac22 commit 39edbbe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/StructUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,11 @@ struct NoArgFieldRef{T}
i::Int
end

(f::NoArgFieldRef{T})(val::S) where {T,S} = setfield!(f.val, f.i, val, Base.isfieldatomic(T, f.i) ? :sequentially_consistent : :not_atomic)
@static if VERSION < v"1.10"
(f::NoArgFieldRef{T})(val::S) where {T,S} = setfield!(f.val, f.i, val)
else
(f::NoArgFieldRef{T})(val::S) where {T,S} = setfield!(f.val, f.i, val, Base.isfieldatomic(T, f.i) ? :sequentially_consistent : :not_atomic)
end

mutable struct FieldRef{T}
set::Bool
Expand Down

0 comments on commit 39edbbe

Please sign in to comment.