13
0

Reinstate code removed that allows building with mingw and the pthreads-win32 library

Newer versions of mingw-w64 can be built with an included pthread implementation
called winpthreads which uses an integer type for pthread_t but pthreads-win32 does
not.
This commit is contained in:
Tim Mayberry 2014-05-08 14:06:18 +10:00
parent da596182e1
commit 86a0f10ac7

View File

@ -75,8 +75,20 @@ class ABSTRACT_UI_API AbstractUI : public BaseUI
};
typedef typename RequestBuffer::rw_vector RequestBufferVector;
#if defined(COMPILER_MINGW) && defined(PTW32_VERSION)
struct pthread_cmp
{
bool operator() (const ptw32_handle_t& thread1, const ptw32_handle_t& thread2)
{
return thread1.p < thread2.p;
}
};
typedef typename std::map<pthread_t,RequestBuffer*, pthread_cmp>::iterator RequestBufferMapIterator;
typedef std::map<pthread_t,RequestBuffer*, pthread_cmp> RequestBufferMap;
#else
typedef typename std::map<pthread_t,RequestBuffer*>::iterator RequestBufferMapIterator;
typedef std::map<pthread_t,RequestBuffer*> RequestBufferMap;
#endif
RequestBufferMap request_buffers;
static Glib::Threads::Private<RequestBuffer> per_thread_request_buffer;