From 191d3ada08df097adbd516ec18b8621d1893ea0f Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Sun, 14 Oct 2018 23:50:51 +0900 Subject: [PATCH] Fix compilation on OS/2 _beginthread() is not declared on __STRICT_ANSI__ mode. ----- [CXX] test/quantize_test.cc.o In file included from ./vp8/common/threading.h:194:0, from ./vp8/encoder/onyx_int.h:24, from test/quantize_test.cc:24: ./vpx_util/vpx_thread.h: In function 'int pthread_create(TID*, const void*, void* (*)(void*), void*)': ./vpx_util/vpx_thread.h:259:20: error: '_beginthread' was not declared in this scope tid = (pthread_t)_beginthread(thread_start, NULL, 1024 * 1024, targ); ^~~~~~~~~~~~ ./vpx_util/vpx_thread.h:259:20: note: suggested alternative: 'thread' tid = (pthread_t)_beginthread(thread_start, NULL, 1024 * 1024, targ); ^~~~~~~~~~~~ thread ----- Change-Id: I774a071162b3876a7f3253ce7c5749f1b0b45818 --- vpx_util/vpx_thread.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vpx_util/vpx_thread.h b/vpx_util/vpx_thread.h index 19a8bfe95..4c20f378b 100644 --- a/vpx_util/vpx_thread.h +++ b/vpx_util/vpx_thread.h @@ -219,6 +219,11 @@ static INLINE int pthread_cond_wait(pthread_cond_t *const condition, #include // NOLINT #include // NOLINT +#if defined(__STRICT_ANSI__) +// _beginthread() is not declared on __STRICT_ANSI__ mode. Declare here. +int _beginthread(void (*)(void *), void *, unsigned, void *); +#endif + #define pthread_t TID #define pthread_mutex_t HMTX -- 2.40.0