Skip to content

Commit 7251f0a

Browse files
Remove intrinsic dependency
This resolves linking error. Resulting executable crash.
1 parent a4519ea commit 7251f0a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

source/juno/com/core.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import juno.base.core,
1919
import std.algorithm;
2020
import std.array;
2121
import std.utf : toUTF8, toUTF16z;
22-
import core.exception, core.memory;
22+
import core.atomic, core.exception, core.memory;
2323
import core.stdc.wchar_ : wcslen;
2424

2525
import std.system;
@@ -3147,17 +3147,17 @@ template QueryInterfaceImpl(TList...) {
31473147
// Implements AddRef & Release for IUnknown subclasses.
31483148
template ReferenceCountImpl() {
31493149

3150-
private int refCount_ = 1;
3151-
private bool finalized_;
3150+
private shared int refCount_ = 1;
3151+
private shared bool finalized_;
31523152

31533153
extern(Windows):
31543154

31553155
uint AddRef() {
3156-
return InterlockedIncrement(refCount_);
3156+
return atomicOp!"+="(refCount_, 1);
31573157
}
31583158

31593159
uint Release() {
3160-
if (InterlockedDecrement(refCount_) == 0) {
3160+
if (atomicOp!"-="(refCount_, 1) == 0) {
31613161
if (!finalized_) {
31623162
finalized_ = true;
31633163
runFinalizer(this);

0 commit comments

Comments
 (0)