mirror of
https://github.com/cuberite/libevent.git
synced 2025-08-04 01:36:23 -04:00
test: fix compilation without thread support (EVENT__DISABLE_THREAD_SUPPORT=ON)
(cherry picked from commit d0adbc05654eca27384b6496cfd8a22ed4dfb4fb)
This commit is contained in:
parent
1121ebed84
commit
5a400c1f28
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "regress.h"
|
#include "regress.h"
|
||||||
|
|
||||||
#ifdef EVENT__HAVE_PTHREADS
|
#ifdef EVENT__HAVE_PTHREADS /** PTHREADS */
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#define THREAD_T pthread_t
|
#define THREAD_T pthread_t
|
||||||
#define THREAD_FN void *
|
#define THREAD_FN void *
|
||||||
@ -40,7 +40,7 @@
|
|||||||
thread_setup(threadvar); \
|
thread_setup(threadvar); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define THREAD_JOIN(th) pthread_join(th, NULL)
|
#define THREAD_JOIN(th) pthread_join(th, NULL)
|
||||||
#else
|
#elif defined(_WIN32) /** _WIN32 */
|
||||||
#define THREAD_T HANDLE
|
#define THREAD_T HANDLE
|
||||||
#define THREAD_FN unsigned __stdcall
|
#define THREAD_FN unsigned __stdcall
|
||||||
#define THREAD_RETURN() return (0)
|
#define THREAD_RETURN() return (0)
|
||||||
@ -51,8 +51,10 @@
|
|||||||
thread_setup(threadvar); \
|
thread_setup(threadvar); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define THREAD_JOIN(th) WaitForSingleObject(th, INFINITE)
|
#define THREAD_JOIN(th) WaitForSingleObject(th, INFINITE)
|
||||||
#endif
|
#endif /* \!_WIN32 */
|
||||||
|
|
||||||
|
#ifndef EVENT__DISABLE_THREAD_SUPPORT
|
||||||
void thread_setup(THREAD_T pthread);
|
void thread_setup(THREAD_T pthread);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user