ecere,ecereCOM: support Emscriptem platform. add new Emscripten interface driver.
[sdk] / ecere / src / sys / Thread.ec
index b172692..33802ec 100644 (file)
@@ -25,6 +25,8 @@ import "instance"
 import "Semaphore"
 #endif
 
+#if !defined(__EMSCRIPTEN__)
+
 public enum ThreadPriority
 {
    normal = 0,
@@ -79,7 +81,7 @@ public class Thread
 #if defined(__WIN32__)
       return returnCode;
 #else
-      return (void *)returnCode;
+      return (void *)(uintptr_t)returnCode;
 #endif
    }
 
@@ -98,7 +100,11 @@ public:
          // printf("Creating %s thread\n", _class.name);
 #if defined(__WIN32__)
          if(!handle)
-            handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadCallBack, this, 0, &id);
+         {
+            DWORD tID;
+            handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadCallBack, this, 0, &tID);
+            id = (uint)tID;
+         }
 #else
          {
             int error;
@@ -164,3 +170,5 @@ public:
 
    property bool created { get { return started; } };
 }
+
+#endif // !defined(__EMSCRIPTEN__)