mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:54:14 +08:00
mdbx: refine type-casting inside mdbx_thread_self() to avoid warning.
2 of 2 for https://github.com/erthink/libmdbx/issues/88 Change-Id: Ic4994141d23a5417b18f6b03a3e4038859fb9210
This commit is contained in:
parent
089d7212e7
commit
75de63dff1
@ -633,12 +633,14 @@ static __maybe_unused __inline uint32_t mdbx_getpid(void) {
|
||||
}
|
||||
|
||||
static __maybe_unused __inline size_t mdbx_thread_self(void) {
|
||||
STATIC_ASSERT(sizeof(mdbx_tid_t) <= sizeof(size_t));
|
||||
mdbx_tid_t thunk;
|
||||
STATIC_ASSERT(sizeof(size_t) >= sizeof(thunk));
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
return GetCurrentThreadId();
|
||||
thunk = GetCurrentThreadId();
|
||||
#else
|
||||
return (size_t)pthread_self();
|
||||
thunk = pthread_self();
|
||||
#endif
|
||||
return (size_t)thunk;
|
||||
}
|
||||
|
||||
MDBX_INTERNAL_FUNC void __maybe_unused mdbx_osal_jitter(bool tiny);
|
||||
|
Loading…
x
Reference in New Issue
Block a user