fix aix compile error

This commit is contained in:
lisr 2021-11-19 10:55:43 +08:00
parent ca1eaedf7b
commit aac187d3a0

View File

@ -230,8 +230,8 @@ SPDLOG_INLINE size_t filesize(FILE *f)
# endif # endif
#else // unix #else // unix
// OpenBSD doesn't compile with :: before the fileno(..) // OpenBSD and AIX doesn't compile with :: before the fileno(..)
# if defined(__OpenBSD__) # if defined(__OpenBSD__) || defined(_AIX)
int fd = fileno(f); int fd = fileno(f);
# else # else
int fd = ::fileno(f); int fd = ::fileno(f);
@ -336,7 +336,9 @@ SPDLOG_INLINE size_t _thread_id() SPDLOG_NOEXCEPT
# define SYS_gettid __NR_gettid # define SYS_gettid __NR_gettid
# endif # endif
return static_cast<size_t>(::syscall(SYS_gettid)); return static_cast<size_t>(::syscall(SYS_gettid));
#elif defined(_AIX) || defined(__DragonFly__) || defined(__FreeBSD__) #elif defined(_AIX)
return static_cast<size_t>(::pthread_self());
#elif defined(__DragonFly__) || defined(__FreeBSD__)
return static_cast<size_t>(::pthread_getthreadid_np()); return static_cast<size_t>(::pthread_getthreadid_np());
#elif defined(__NetBSD__) #elif defined(__NetBSD__)
return static_cast<size_t>(::_lwp_self()); return static_cast<size_t>(::_lwp_self());