summaryrefslogtreecommitdiff
path: root/thread_win32.ci
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-21 08:48:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-21 08:48:29 +0000
commit2840fa6b6504de820c3ca40457306787545d27fe (patch)
treec1b027de2d2a1a4a79e608ac8db25001fba8abde /thread_win32.ci
parent92cad4305b1751fcea0bcfe1386e8f8cba265167 (diff)
* common.mk: inverted rules order.
* thread_win32.ci (w32_create_thread): bcc does not have _beginthreadex(). * bcc32/Makefile.sub: headers have moved. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.ci')
-rw-r--r--thread_win32.ci22
1 files changed, 18 insertions, 4 deletions
diff --git a/thread_win32.ci b/thread_win32.ci
index ca4241b9e9..bfb7f681c7 100644
--- a/thread_win32.ci
+++ b/thread_win32.ci
@@ -140,10 +140,24 @@ w32_resume_thread(HANDLE handle)
}
}
+#ifdef _MSC_VER
+#define HAVE__BEGINTHREADEX 1
+#else
+#undef HAVE__BEGINTHREADEX
+#endif
+
+#ifdef HAVE__BEGINTHREADEX
+#define start_thread (HANDLE)_beginthreadex
+typedef unsigned long (_stdcall *w32_thread_start_func)(void*);
+#else
+#define start_thread CreateThread
+typedef LPTHREAD_START_ROUTINE w32_thread_start_func;
+#endif
+
static HANDLE
-w32_create_thread(DWORD stack_size, void *func, void *val)
+w32_create_thread(DWORD stack_size, w32_thread_start_func func, void *val)
{
- return (HANDLE)_beginthreadex(0, stack_size, func, val, CREATE_SUSPENDED, 0);
+ return start_thread(0, stack_size, func, val, CREATE_SUSPENDED, 0);
}
int
@@ -289,7 +303,7 @@ native_thread_destroy(rb_thread_t *th)
w32_close_handle(intr);
}
-static unsigned int _stdcall
+static unsigned long _stdcall
thread_start_func_1(void *th_ptr)
{
rb_thread_t *th = th_ptr;
@@ -364,7 +378,7 @@ static void timer_thread_function(void);
static HANDLE timer_thread_id = 0;
-static unsigned int _stdcall
+static unsigned long _stdcall
timer_thread_func(void *dummy)
{
thread_debug("timer_thread\n");