All the Atomic... functions in Mt.h (be it WIN32 or POSIX) return int - but shouldn't it be Atomic?
The type of Atomic depends:
MT & POSIX: _Atomic_word -> int
MT & WIN32: LONG -> long
ST & POSIX: int
ST & WIN32: int
Indeed the called WIN32 functions Interlocked... return long. So, to avoid implicit casts it might be preferable to adapt the return type of the Atomic... functions. If I then assign an Atomic to an int, I am seeing what I am doing.
Werner
Well, but you should not directly assign Atomic to int, you should rather use AtomicRead...