-#if defined(__VISUALC__) || \
- (defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)) || \
- (defined(__GNUG__) && defined(__MSVCRT__))
- typedef unsigned (__stdcall *RtlThreadStart)(void *);
-
- m_hThread = (HANDLE)_beginthreadex(NULL, 0,
- (RtlThreadStart)
- wxThreadInternal::WinThreadStart,
- thread, CREATE_SUSPENDED,
- (unsigned int *)&m_tid);
+#ifdef wxUSE_BEGIN_THREAD
+
+ // Watcom is reported to not like 0 stack size (which means "use default"
+ // for the other compilers and is also the default value for stackSize)
+#ifdef __WATCOMC__
+ if ( !stackSize )
+ stackSize = 10240;
+#endif // __WATCOMC__
+
+ m_hThread = (HANDLE)_beginthreadex
+ (
+ NULL, // default security
+ stackSize,
+ wxThreadInternal::WinThreadStart, // entry point
+ thread,
+ CREATE_SUSPENDED,
+ (unsigned int *)&m_tid
+ );