From 4013d71792b7029d6bd49a73ea3cc79b186a43f5 Mon Sep 17 00:00:00 2001 From: Mark Swaanenburg Date: Tue, 6 Mar 2018 09:34:29 +0100 Subject: [PATCH] Don't use fstat64 when _LARGEFILE_SOURCE is defined Using fstat64 on ancient distributions like RHEL5 causes errors because fstat64 is declared inline, but there's no definition. Modern compilers don't like that without the -fgnu89-inline flag. --- include/spdlog/details/os.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 4de7b9f8..0866413c 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -248,7 +248,7 @@ inline size_t filesize(FILE *f) #else // unix int fd = fileno(f); //64 bits(but not in osx or cygwin, where fstat64 is deprecated) -#if !defined(__FreeBSD__) && !defined(__APPLE__) && (defined(__x86_64__) || defined(__ppc64__)) && !defined(__CYGWIN__) +#if !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(_LARGEFILE_SOURCE) && (defined(__x86_64__) || defined(__ppc64__)) && !defined(__CYGWIN__) struct stat64 st ; if (fstat64(fd, &st) == 0) return static_cast(st.st_size);