Skip to content

adds size: sizeof(cint) to imported enums #24680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/pure/concurrency/atomics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ when (defined(cpp) and defined(nimUseCppAtomics)) or defined(nimdoc):
{.push, header: "<atomic>".}

type
MemoryOrder* {.importcpp: "std::memory_order".} = enum
MemoryOrder* {.importcpp: "std::memory_order", size: sizeof(cint).} = enum
## Specifies how non-atomic operations can be reordered around atomic
## operations.

Expand Down Expand Up @@ -286,7 +286,7 @@ else:
x

type
MemoryOrder* {.importc: "memory_order".maybeWrapStd.} = enum
MemoryOrder* {.importc: "memory_order".maybeWrapStd, size: sizeof(cint).} = enum
moRelaxed
moConsume
moAcquire
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/concurrency/tatomics.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
discard """
# test C with -d:nimUseCppAtomics as well to check nothing breaks
matrix: "--mm:refc; --mm:orc; --mm:refc -d:nimUseCppAtomics; --mm:orc -d:nimUseCppAtomics"
matrix: "--mm:refc; --mm:orc -d:checkabi; --mm:refc -d:nimUseCppAtomics; --mm:orc -d:nimUseCppAtomics"
targets: "c cpp"
"""

Expand Down
Loading