Skip to content

Commit 069e113

Browse files
committed
Ensure QuoteNodes contain requested data type
1 parent f09463a commit 069e113

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/api_types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ end
253253
# Dataspace constants
254254
@defconstants H5S begin
255255
# atomic data types
256-
ALL::hid_t = 0
257-
UNLIMITED::hid_t = typemax(hsize_t)
256+
ALL::hsize_t = 0
257+
UNLIMITED::hsize_t = typemax(hsize_t)
258258

259259
# Types of dataspaces (C enum H5S_class_t)
260260
SCALAR::hid_t = hid_t(0)

src/macros.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@ macro defconstants(prefix::Symbol, expr::Expr)
6464
# Save type for later use
6565
push!(imports, type)
6666

67-
value = isruntime ? esc(:(Ref{$type}())) :
68-
QuoteNode(Core.eval(__module__, line.args[2]))
67+
if isruntime
68+
value = esc(:(Ref{$type}()))
69+
else
70+
valexpr = :(convert($type, $(line.args[2])))
71+
value = QuoteNode(Core.eval(__module__, valexpr))
72+
end
6973
fullname = esc(:($innermod.$name))
7074
getexpr = isruntime ? :($(fullname)[]) : fullname
7175

0 commit comments

Comments
 (0)