Fix compilation w/ Atomic[T] types (#10607)
This commit is contained in:
parent
d70dd6f3cb
commit
048a7a6539
1 changed files with 2 additions and 2 deletions
|
|
@ -136,7 +136,7 @@ else:
|
||||||
# A type that is known to be atomic and whose size is known at
|
# A type that is known to be atomic and whose size is known at
|
||||||
# compile time to be 8 bytes or less
|
# compile time to be 8 bytes or less
|
||||||
|
|
||||||
template nonAtomicType(T: typedesc[Trivial]): untyped =
|
template nonAtomicType*(T: typedesc[Trivial]): untyped =
|
||||||
# Maps types to integers of the same size
|
# Maps types to integers of the same size
|
||||||
when sizeof(T) == 1: int8
|
when sizeof(T) == 1: int8
|
||||||
elif sizeof(T) == 2: int16
|
elif sizeof(T) == 2: int16
|
||||||
|
|
@ -252,7 +252,7 @@ else:
|
||||||
AtomicInt32 {.importc: "_Atomic NI32".} = object
|
AtomicInt32 {.importc: "_Atomic NI32".} = object
|
||||||
AtomicInt64 {.importc: "_Atomic NI64".} = object
|
AtomicInt64 {.importc: "_Atomic NI64".} = object
|
||||||
|
|
||||||
template atomicType(T: typedesc[Trivial]): untyped =
|
template atomicType*(T: typedesc[Trivial]): untyped =
|
||||||
# Maps the size of a trivial type to it's internal atomic type
|
# Maps the size of a trivial type to it's internal atomic type
|
||||||
when sizeof(T) == 1: AtomicInt8
|
when sizeof(T) == 1: AtomicInt8
|
||||||
elif sizeof(T) == 2: AtomicInt16
|
elif sizeof(T) == 2: AtomicInt16
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue