From 79e105243c6ecb2e41f42ea50abc076b5fd2f7df Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 29 Nov 2019 12:48:21 +0200 Subject: [PATCH] Fix #1335 --- include/spdlog/details/os-inl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index 1a63b0f8..8473eb09 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -230,7 +230,12 @@ SPDLOG_INLINE size_t filesize(FILE *f) #endif #else // unix +// OpenBSD doesn't compile with :: before the fileno(..) +#if defined(__OpenBSD__) + int fd = fileno(f); +#else int fd = ::fileno(f); +#endif // 64 bits(but not in osx or cygwin, where fstat64 is deprecated) #if (defined(__linux__) || defined(__sun) || defined(_AIX)) && (defined(__LP64__) || defined(_LP64)) struct stat64 st;