fixes Undefined reference to nni_atomic_dec & nni_atomic_dec64 on Windows.
@@ -265,6 +265,16 @@ nni_atomic_dec64_nv(nni_atomic_u64 *v)
#endif
}
+void
+nni_atomic_dec64(nni_atomic_u64 *v)
+{
+#ifdef _WIN64
+ InterlockedDecrementAcquire64(&v->v);
+#else
+ InterlockedDecrement64(&v->v);
+#endif
+}
+
bool
nni_atomic_cas64(nni_atomic_u64 *v, uint64_t comp, uint64_t new)
{
@@ -323,6 +333,12 @@ nni_atomic_dec_nv(nni_atomic_int *v)
return (InterlockedDecrementRelease(&v->v));
}
+void
+nni_atomic_dec(nni_atomic_int *v)
+{
+ (void) InterlockedDecrementAcquire(&v->v);
+}
+
bool
nni_atomic_cas(nni_atomic_int *v, int comp, int new)
{
