ref: 191d3ada08df097adbd516ec18b8621d1893ea0f
parent: 0080704038530fc674c8b9b20c1741645ef65819
author: KO Myung-Hun <komh@chollian.net>
date: Sun Oct 14 19:50:51 EDT 2018
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
--- a/vpx_util/vpx_thread.h
+++ b/vpx_util/vpx_thread.h
@@ -219,6 +219,11 @@
#include <stdlib.h> // NOLINT
#include <sys/builtin.h> // 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
--
⑨