Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: runtime/vm/atomic_win.h

Issue 1290613002: Allow simulator runs on Windows: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/thread_interrupter_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/atomic_win.h
diff --git a/runtime/vm/atomic_win.h b/runtime/vm/atomic_win.h
index 433d32e86d52db439b6ea964e0e1bd2e300ba171..0c31e592aa6b4d1bee4cb70f00f0df0c2562b8fb 100644
--- a/runtime/vm/atomic_win.h
+++ b/runtime/vm/atomic_win.h
@@ -16,27 +16,27 @@
namespace dart {
inline uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) {
-#if defined(TARGET_ARCH_X64)
+#if defined(HOST_ARCH_X64)
return static_cast<uintptr_t>(
InterlockedIncrement64(reinterpret_cast<LONGLONG*>(p))) - 1;
-#elif defined(TARGET_ARCH_IA32)
+#elif defined(HOST_ARCH_IA32)
return static_cast<uintptr_t>(
InterlockedIncrement(reinterpret_cast<LONG*>(p))) - 1;
#else
- UNIMPLEMENTED();
+#error Unsupported host architecture.
#endif
}
inline intptr_t AtomicOperations::FetchAndAdd(intptr_t* p, intptr_t delta) {
-#if defined(TARGET_ARCH_X64)
+#if defined(HOST_ARCH_X64)
return static_cast<intptr_t>(
InterlockedAdd64(reinterpret_cast<LONGLONG*>(p), delta)) - delta;
-#elif defined(TARGET_ARCH_IA32)
+#elif defined(HOST_ARCH_IA32)
return static_cast<intptr_t>(
InterlockedAdd(reinterpret_cast<LONG*>(p), delta)) - delta;
#else
- UNIMPLEMENTED();
+#error Unsupported host architecture.
#endif
}
@@ -45,18 +45,18 @@ inline intptr_t AtomicOperations::FetchAndAdd(intptr_t* p, intptr_t delta) {
inline uword AtomicOperations::CompareAndSwapWord(uword* ptr,
uword old_value,
uword new_value) {
-#if defined(TARGET_ARCH_X64)
+#if defined(HOST_ARCH_X64)
return static_cast<uword>(
InterlockedCompareExchange64(reinterpret_cast<LONGLONG*>(ptr),
static_cast<LONGLONG>(new_value),
static_cast<LONGLONG>(old_value)));
-#elif defined(TARGET_ARCH_IA32)
+#elif defined(HOST_ARCH_IA32)
return static_cast<uword>(
InterlockedCompareExchange(reinterpret_cast<LONG*>(ptr),
static_cast<LONG>(new_value),
static_cast<LONG>(old_value)));
#else
- UNIMPLEMENTED();
+#error Unsupported host architecture.
#endif
}
#endif // !defined(USING_SIMULATOR)
« no previous file with comments | « no previous file | runtime/vm/thread_interrupter_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698