From a22b12087c62bfef1d7cb95ab1986cba1ec1a638 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner <60898866+LilithHafner@users.noreply.github.com> Date: Thu, 17 Feb 2022 20:36:09 -0600 Subject: [PATCH] Try to fix build error (8) --- base/sort.jl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/base/sort.jl b/base/sort.jl index 4655fc617675a..f3faf96217edb 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -1332,13 +1332,17 @@ right(o::Perm) = Perm(right(o.order), o.data) lt(::Left, x::T, y::T) where {T<:Floats} = slt_int(y, x) lt(::Right, x::T, y::T) where {T<:Floats} = slt_int(x, y) -for (float, int) in ((Float32, Int32), (Float64, Int64)) - @eval Serial.serialize(x::$float, ::Left) = Serial.serialize(reinterpret($int, x), Reverse) - @eval Serial.deserialize(T::Type{$float}, u::unsigned($int), ::Left) = reinterpret($float, Serial.deserialize($int, u, Reverse)) - @eval Serial.serialize(x::$float, ::Right) = Serial.serialize(reinterpret($int, x), Forward) - @eval Serial.deserialize(T::Type{$float}, u::unsigned($int), ::Right) = reinterpret($float, Serial.deserialize($int, u, Forward)) - @eval Serial.Serializable(::Type{$float}, ::Union{Left, Right}) = unsigned($int) -end +Serial.serialize(x::Float32, ::Left) = Serial.serialize(reinterpret(Int32, x), Reverse) +Serial.deserialize(::Type{Float32}, u::UInt32, ::Left) = reinterpret(Float32, Serial.deserialize(Int32, u, Reverse)) +Serial.serialize(x::Float32, ::Right) = Serial.serialize(reinterpret(Int32, x), Forward) +Serial.deserialize(::Type{Float32}, u::UInt32, ::Right) = reinterpret(Float32, Serial.deserialize(Int32, u, Forward)) +Serial.Serializable(::Type{Float32}, ::Union{Left, Right}) = UInt32 + +Serial.serialize(x::Float64, ::Left) = Serial.serialize(reinterpret(Int64, x), Reverse) +Serial.deserialize(::Type{Float64}, u::UInt64, ::Left) = reinterpret(Float64, Serial.deserialize(Int64, u, Reverse)) +Serial.serialize(x::Float64, ::Right) = Serial.serialize(reinterpret(Int64, x), Forward) +Serial.deserialize(::Type{Float64}, u::UInt64, ::Right) = reinterpret(Float64, Serial.deserialize(Int64, u, Forward)) +Serial.Serializable(::Type{Float64}, ::Union{Left, Right}) = UInt64 isnan(o::DirectOrdering, x::Floats) = (x!=x) isnan(o::DirectOrdering, x::Missing) = false