From a045270164d38412d15ee2772d2853b217dc89d0 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sat, 23 Dec 2023 10:23:25 +0000 Subject: [PATCH] build: don't fseeko64()/ftello64() on musl libc Check for musl libc in Patch.cpp and use fseeko()/ftello() in that case instead of fseeko64()/ftello64() as well, as the 64 variants are glibc extensions. Signed-off-by: Rafael Kitover --- src/common/Patch.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/common/Patch.cpp b/src/common/Patch.cpp index d1d20db9..29e3f006 100644 --- a/src/common/Patch.cpp +++ b/src/common/Patch.cpp @@ -15,8 +15,18 @@ #ifndef __LIBRETRO__ +#ifdef __linux__ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include +#ifndef __USE_GNU +#define __MUSL__ +#endif +#endif + #ifdef __GNUC__ -#if defined(__APPLE__) || defined(BSD) || defined(__NetBSD__) +#if defined(__MUSL__) || defined(__APPLE__) || defined(BSD) || defined(__NetBSD__) typedef off_t __off64_t; /* off_t is 64 bits on BSD. */ #define fseeko64 fseeko #define ftello64 ftello