Browse Source

Show errors if HXCPP_MULTI_THREADED is not defined

Hugh Sanderson 16 years ago
parent
commit
c3a6d4c836
5 changed files with 28 additions and 0 deletions
  1. 6 0
      std/cpp/vm/Deque.hx
  2. 6 0
      std/cpp/vm/Lock.hx
  3. 6 0
      std/cpp/vm/Mutex.hx
  4. 4 0
      std/cpp/vm/Thread.hx
  5. 6 0
      std/cpp/vm/Tls.hx

+ 6 - 0
std/cpp/vm/Deque.hx

@@ -24,6 +24,8 @@
  */
  */
 package cpp.vm;
 package cpp.vm;
 
 
+#if HXCPP_MULTI_THREADED
+
 class Deque<T> {
 class Deque<T> {
 	var q : Dynamic;
 	var q : Dynamic;
 	public function new() {
 	public function new() {
@@ -39,3 +41,7 @@ class Deque<T> {
 		return untyped __global__.__hxcpp_deque_pop(q,block);
 		return untyped __global__.__hxcpp_deque_pop(q,block);
 	}
 	}
 }
 }
+
+#else
+You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Deque_class
+#end

+ 6 - 0
std/cpp/vm/Lock.hx

@@ -24,6 +24,8 @@
  */
  */
 package cpp.vm;
 package cpp.vm;
 
 
+#if HXCPP_MULTI_THREADED
+
 class Lock {
 class Lock {
 	var l : Dynamic;
 	var l : Dynamic;
 	public function new() {
 	public function new() {
@@ -36,3 +38,7 @@ class Lock {
 		untyped __global__.__hxcpp_lock_release(l);
 		untyped __global__.__hxcpp_lock_release(l);
 	}
 	}
 }
 }
+
+#else
+You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Lock_class
+#end

+ 6 - 0
std/cpp/vm/Mutex.hx

@@ -24,6 +24,8 @@
  */
  */
 package cpp.vm;
 package cpp.vm;
 
 
+#if HXCPP_MULTI_THREADED
+
 class Mutex {
 class Mutex {
 	var m : Dynamic;
 	var m : Dynamic;
 
 
@@ -40,3 +42,7 @@ class Mutex {
 		untyped __global__.__hxcpp_mutex_release(m);
 		untyped __global__.__hxcpp_mutex_release(m);
 	}
 	}
 }
 }
+
+#else
+You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Mutex_class
+#end

+ 4 - 0
std/cpp/vm/Thread.hx

@@ -26,6 +26,7 @@ package cpp.vm;
 
 
 typedef ThreadHandle = Dynamic;
 typedef ThreadHandle = Dynamic;
 
 
+#if HXCPP_MULTI_THREADED
 class Thread {
 class Thread {
 
 
 	var handle : ThreadHandle;
 	var handle : ThreadHandle;
@@ -70,3 +71,6 @@ class Thread {
 	}
 	}
 
 
 }
 }
+#else
+You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Thread_class
+#end

+ 6 - 0
std/cpp/vm/Tls.hx

@@ -24,6 +24,8 @@
  */
  */
 package cpp.vm;
 package cpp.vm;
 
 
+#if HXCPP_MULTI_THREADED
+
 class Tls<T> {
 class Tls<T> {
 
 
 	static var sFreeSlot = 0;
 	static var sFreeSlot = 0;
@@ -44,3 +46,7 @@ class Tls<T> {
 	}
 	}
 
 
 }
 }
+
+#else
+You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Tls_class
+#end