@Araq Here is a minimal example. This is compiled with "vcc". It compiles to C,
but not to C++.
type
VolatilePtr*[T] = distinct ptr T
proc toVolatilePtr*[T](t: var T): VolatilePtr[T] =
cast[VolatilePtr[T]](addr t)
# Pretend we're actually checking it's
Please give me more details.
@Araq I have read it, several times. But I do not see how this helps me, if I
don't want to directly read or write a volatile, but rather I have to pass a
pointer to a volatile location to an OS method that expects one.
`volatile.nim` is a stdlib module, you can read its code to see how it works.
Don't use the type system to model `volatile`, that does not work well.
I'm (still) trying to put the "missing bits" of atomic methods together into a
cross-platform/cross-backend module. I've now got to the point that the VCC C
version compiles and run (I only test with one thread, so idk if it really
gives the expected atomic behaviour yet). When I try to build
Thank you Araq.
Can I assume that a var parameter will always be a pointer where I can use
(addr varParm) as copymem destination. It seems to work but I can copy to
tempory local variable and use normal assignment if there is no guarentee it
will always work.