]> git.saurik.com Git - wxWidgets.git/commitdiff
use _beginthreadex() for mingw32 if possible
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 28 Feb 2000 17:33:56 +0000 (17:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 28 Feb 2000 17:33:56 +0000 (17:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/thread.cpp

index ac600434e9e7c561be8265db2635984639c2d4ae..439992a63a7b7f37c74c362a1bbd13e8b81669b6 100644 (file)
@@ -454,7 +454,9 @@ bool wxThreadInternal::Create(wxThread *thread)
     // for compilers which have it, we should use C RTL function for thread
     // creation instead of Win32 API one because otherwise we will have memory
     // leaks if the thread uses C RTL (and most threads do)
-#if defined(__VISUALC__) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x500))
+#if defined(__VISUALC__) || \
+    (defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)) \\
+    (defined(__GNUG__) && defined(__MSVCRT__)
     typedef unsigned (__stdcall *RtlThreadStart)(void *);
 
     m_hThread = (HANDLE)_beginthreadex(NULL, 0,
@@ -462,7 +464,7 @@ bool wxThreadInternal::Create(wxThread *thread)
                                        wxThreadInternal::WinThreadStart,
                                        thread, CREATE_SUSPENDED,
                                        (unsigned int *)&m_tid);
-#else // !VC++
+#else // compiler doesn't have _beginthreadex
     m_hThread = ::CreateThread
                   (
                     NULL,                               // default security
@@ -473,7 +475,7 @@ bool wxThreadInternal::Create(wxThread *thread)
                     CREATE_SUSPENDED,                   // flags
                     &m_tid                              // [out] thread id
                   );
-#endif // VC++/!VC++
+#endif // _beginthreadex/CreateThread
 
     if ( m_hThread == NULL )
     {