diff options
author | Teodor Mircea Ionita <teodor@mariadb.org> | 2018-05-10 12:23:35 +0300 |
---|---|---|
committer | Teodor Mircea Ionita <teodor@mariadb.org> | 2018-05-10 12:23:35 +0300 |
commit | 6620fbd62a7465d2aa5010851aabdcd6ec31893f (patch) | |
tree | 41e4632daaeef3c9cfa2aa9873675ec85728e10c /storage | |
parent | 70e88b5089e006c157f43c4685eff8147351e441 (diff) | |
download | mariadb-git-6620fbd62a7465d2aa5010851aabdcd6ec31893f.tar.gz |
MDEV-15778: On macOS pthread_t is opaque, requires explicit cast
On macOS pthread id is a pointer to struct _opaque_pthread_t type,
requires explicit cast to ulint which in turn is size_t;
Was failing with Clang 9.1.0 Debug build on macOS 10.13.4:
sync0policy.h:53:4: error: cannot initialize a member subobject of type 'ulint'
(aka 'unsigned long') with an rvalue of type 'os_thread_id_t' (aka '_opaque_pthread_t *')
m_thread_id(os_thread_id_t(ULINT_UNDEFINED))
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sync0policy.h:79:4: error: cannot initialize a parameter of type 'int64' (aka 'long long') with
an rvalue of type 'os_thread_id_t' (aka '_opaque_pthread_t *')
my_atomic_storelint(&m_thread_id, os_thread_get_curr_id());
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/include/sync0policy.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/innobase/include/sync0policy.h b/storage/innobase/include/sync0policy.h index 56398203117..bbb0064fb28 100644 --- a/storage/innobase/include/sync0policy.h +++ b/storage/innobase/include/sync0policy.h @@ -50,7 +50,7 @@ public: m_mutex(), m_filename(), m_line(), - m_thread_id(os_thread_id_t(ULINT_UNDEFINED)) + m_thread_id(ULINT_UNDEFINED) { /* No op */ } @@ -76,7 +76,7 @@ public: { m_mutex = mutex; - my_atomic_storelint(&m_thread_id, os_thread_get_curr_id()); + my_atomic_storelint(&m_thread_id, reinterpret_cast<ulint>(os_thread_get_curr_id())); m_filename = filename; |