Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 1 | From 6690e7fe566445e20fec178e9e209e5f9f2fdde3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 5 Apr 2023 23:33:46 -0700 |
| 4 | Subject: [PATCH] Do not use LFS64 functions on linux/musl |
| 5 | |
| 6 | On musl, off_t is 64bit always ( even on 32bit platforms ), therefore using |
| 7 | LFS64 funcitons is not needed on such platforms. Moreover, musl has stopped |
| 8 | providing aliases for these functions [1] which means it wont compile on |
| 9 | newer musl systems. Therefore only use it on 32bit glibc/linux platforms |
| 10 | and exclude musl like cygwin or OSX |
| 11 | |
| 12 | [1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4 |
| 13 | |
| 14 | Upstream-Status: Submitted [https://github.com/gabime/spdlog/pull/2589] |
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 16 | --- |
| 17 | thirdparty/spdlog-20170710/include/spdlog/details/os.h | 2 +- |
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 19 | |
| 20 | diff --git a/thirdparty/spdlog-20170710/include/spdlog/details/os.h b/thirdparty/spdlog-20170710/include/spdlog/details/os.h |
| 21 | index 735f60147..639b07a79 100644 |
| 22 | --- a/thirdparty/spdlog-20170710/include/spdlog/details/os.h |
| 23 | +++ b/thirdparty/spdlog-20170710/include/spdlog/details/os.h |
| 24 | @@ -237,7 +237,7 @@ inline size_t filesize(FILE *f) |
| 25 | #else // unix |
| 26 | int fd = fileno(f); |
| 27 | //64 bits(but not in osx, where fstat64 is deprecated) |
| 28 | -#if !defined(__FreeBSD__) && !defined(__APPLE__) && (defined(__x86_64__) || defined(__ppc64__)) |
| 29 | +#if !defined(__FreeBSD__) && !defined(__APPLE__) && ((defined(__x86_64__) || defined(__ppc64__)) && (!defined(__linux__))) |
| 30 | struct stat64 st; |
| 31 | if (fstat64(fd, &st) == 0) |
| 32 | return static_cast<size_t>(st.st_size); |
| 33 | -- |
| 34 | 2.40.0 |
| 35 | |