mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
make C++ atomic opt in via -d:nimUseCppAtomics (#24209)
refs #24207 The `-d:nimUseCAtomics` flag added in #24207 is now inverted and made into `-d:nimUseCppAtomics`, which means C++ atomics are only enabled with the define. This flag is now also documented and tested.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
discard """
|
||||
matrix: "--mm:refc; --mm:orc"
|
||||
# test C with -d:nimUseCppAtomics as well to check nothing breaks
|
||||
matrix: "--mm:refc; --mm:orc; --mm:refc -d:nimUseCppAtomics; --mm:orc -d:nimUseCppAtomics"
|
||||
targets: "c cpp"
|
||||
"""
|
||||
|
||||
# test atomic operations
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
discard """
|
||||
matrix: "--mm:refc; --mm:orc"
|
||||
# test C with -d:nimUseCppAtomics as well to check nothing breaks
|
||||
matrix: "--mm:refc; --mm:orc; --mm:refc -d:nimUseCppAtomics; --mm:orc -d:nimUseCppAtomics"
|
||||
targets: "c cpp"
|
||||
"""
|
||||
import std/atomics
|
||||
@@ -17,4 +18,4 @@ block testSize: # issue 12726
|
||||
f: AtomicFlag
|
||||
static:
|
||||
doAssert sizeof(Node) == sizeof(pointer)
|
||||
doAssert sizeof(MyChannel) == sizeof(pointer) * 2
|
||||
doAssert sizeof(MyChannel) == sizeof(pointer) * 2
|
||||
|
||||
Reference in New Issue
Block a user