Skip to content

Commit d69627e

Browse files
committed
Fix test
Julia 0.4 eagerly expands macros and complains if they are not defined. The hacky solution is to use eval...
1 parent e1491d7 commit d69627e

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/HaarMeasure.jl

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,16 @@ end
6666
#4235–4245 (1994).
6767

6868
using Base.LinAlg: BlasInt
69+
_blasfunc = Base.VERSION < v"0.5-" ? Base.blasfunc : eval(Base, "@blasfunc")
6970
for (s, elty) in (("dlarfg_", Float64),
7071
("zlarfg_", Complex128))
71-
if Base.VERSION < v"0.5-"
72-
@eval begin
73-
function larfg!(n::Int, α::Ptr{$elty}, x::Ptr{$elty}, incx::Int, τ::Ptr{$elty})
74-
ccall(($(Base.blasfunc(s)), Base.liblapack_name), Void,
75-
(Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}),
76-
&n, α, x, &incx, τ)
77-
end
78-
end
79-
else
80-
@eval begin
81-
function larfg!(n::Int, α::Ptr{$elty}, x::Ptr{$elty}, incx::Int, τ::Ptr{$elty})
82-
ccall(($(Base.@blasfunc(s)), Base.liblapack_name), Void,
83-
(Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}),
84-
&n, α, x, &incx, τ)
85-
end
72+
73+
blass = _blasfunc(s)
74+
@eval begin
75+
function larfg!(n::Int, α::Ptr{$elty}, x::Ptr{$elty}, incx::Int, τ::Ptr{$elty})
76+
ccall(($blass, Base.liblapack_name), Void,
77+
(Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}),
78+
&n, α, x, &incx, τ)
8679
end
8780
end
8881
end

0 commit comments

Comments
 (0)