Fix compilation on OS/2
authorKO Myung-Hun <komh@chollian.net>
Sun, 14 Oct 2018 14:50:51 +0000 (23:50 +0900)
committerKO Myung-Hun <komh@chollian.net>
Tue, 16 Oct 2018 08:00:15 +0000 (17:00 +0900)
_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

index 19a8bfe..4c20f37 100644 (file)
@@ -219,6 +219,11 @@ static INLINE int pthread_cond_wait(pthread_cond_t *const condition,
 #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