1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
From 7f09478f4522b65b476c788a696159e5a4974286 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 13 Dec 2023 21:00:08 +0100
Subject: [PATCH] Clean up and fix fseek64/ftell64
Upstream: https://gitlab.com/free-astro/siril/-/merge_requests/606
Test for the exception systems, GNU and Windows, and then fall back to
standard POSIX.
This fixes build with musl libc, which does not have fseeko64/ftello64.
Fixes https://gitlab.com/free-astro/siril/-/issues/1241
--- a/src/io/avi_pipp/pipp_utf8.h
+++ b/src/io/avi_pipp/pipp_utf8.h
@@ -31,27 +31,15 @@
#endif
// 64-bit fseek for various platforms
-#ifdef __linux__
-#define fseek64 fseeko64 // Linux
-#define ftell64 ftello64 // Linux
-#elif defined (OS_OSX)
-#define fseek64 fseeko // OS X
-#define ftell64 ftello // OS X
-#elif defined(BSD)
-#define fseek64 fseeko // DragonFly BSD, FreeBSD, OpenBSD, NetBSD
-#define ftell64 ftello // DragonFly BSD, FreeBSD, OpenBSD, NetBSD
-#elif defined (__FreeBSD_kernel__) && defined (__GLIBC__)
-#define fseek64 fseeko64 // KFreeBSD
-#define ftell64 ftello64 // KFreeBSD
-#elif defined (__gnu_hurd__)
-#define fseek64 fseeko64 // GNU/Hurd
-#define ftell64 ftello64 // GNU/Hurd
-#elif defined(__CYGWIN__)
-#define fseek64 fseeko // CYGWIN
-#define ftell64 ftello // CYGWIN
-#else
+#if defined(__GLIBC__) || defined(__gnu_hurd__)
+#define fseek64 fseeko64 // GNU
+#define ftell64 ftello64 // GNU
+#elif defined(_WIN32)
#define fseek64 _fseeki64 // Windows
#define ftell64 _ftelli64 // Windows
+#else // POSIX
+#define fseek64 fseeko // OS X, DragonFly BSD, FreeBSD, OpenBSD, NetBSD, musl
+#define ftell64 ftello // OS X, DragonFly BSD, FreeBSD, OpenBSD, NetBSD, musl
#endif
#endif // PIPP_UTF8_H
--
GitLab
|