aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-tv/kodi/files/musl/0002-fix-fileemu.patch')
-rw-r--r--media-tv/kodi/files/musl/0002-fix-fileemu.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/media-tv/kodi/files/musl/0002-fix-fileemu.patch b/media-tv/kodi/files/musl/0002-fix-fileemu.patch
new file mode 100644
index 00000000..25b8e5ae
--- /dev/null
+++ b/media-tv/kodi/files/musl/0002-fix-fileemu.patch
@@ -0,0 +1,94 @@
+From eee360d98c2a506a3124b538a9f6629596607698 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Wed, 24 Apr 2019 10:10:22 -0500
+Subject: [PATCH 2/7] fix fileemu
+
+---
+ xbmc/cores/DllLoader/exports/emu_msvcrt.cpp | 15 +++++++++------
+ xbmc/cores/DllLoader/exports/emu_msvcrt.h | 2 +-
+ xbmc/cores/DllLoader/exports/wrapper.c | 2 +-
+ 3 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
+index 5546f6e..c40eee8 100644
+--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
++++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
+@@ -38,6 +38,7 @@
+ #include <fcntl.h>
+ #include <time.h>
+ #include <signal.h>
++#include <paths.h>
+ #ifdef TARGET_POSIX
+ #include "PlatformDefs.h" // for __stat64
+ #include "XFileUtils.h"
+@@ -1480,7 +1481,7 @@ extern "C"
+ int ret;
+
+ ret = dll_fgetpos64(stream, &tmpPos);
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ *pos = (fpos_t)tmpPos;
+ #else
+ pos->__pos = (off_t)tmpPos.__pos;
+@@ -1493,8 +1494,9 @@ extern "C"
+ CFile* pFile = g_emuFileWrapper.GetFileXbmcByStream(stream);
+ if (pFile != NULL)
+ {
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+- *pos = pFile->GetPosition();
++#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
++ uint64_t *ppos = (uint64_t *) pos;
++ *ppos = pFile->GetPosition();
+ #else
+ pos->__pos = pFile->GetPosition();
+ #endif
+@@ -1509,8 +1511,9 @@ extern "C"
+ int fd = g_emuFileWrapper.GetDescriptorByStream(stream);
+ if (fd >= 0)
+ {
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+- if (dll_lseeki64(fd, *pos, SEEK_SET) >= 0)
++#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
++ const uint64_t *ppos = (const uint64_t *) pos;
++ if (dll_lseeki64(fd, *ppos, SEEK_SET) >= 0)
+ #else
+ if (dll_lseeki64(fd, (__off64_t)pos->__pos, SEEK_SET) >= 0)
+ #endif
+@@ -1532,7 +1535,7 @@ extern "C"
+ if (fd >= 0)
+ {
+ fpos64_t tmpPos;
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ tmpPos= *pos;
+ #else
+ tmpPos.__pos = (off64_t)(pos->__pos);
+diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.h b/xbmc/cores/DllLoader/exports/emu_msvcrt.h
+index eb30c44..d8ca2cb 100644
+--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.h
++++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.h
+@@ -12,7 +12,7 @@
+ #define _onexit_t void*
+ #endif
+
+-#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ typedef off_t __off_t;
+ typedef int64_t off64_t;
+ typedef off64_t __off64_t;
+diff --git a/xbmc/cores/DllLoader/exports/wrapper.c b/xbmc/cores/DllLoader/exports/wrapper.c
+index d618565..05e6368 100644
+--- a/xbmc/cores/DllLoader/exports/wrapper.c
++++ b/xbmc/cores/DllLoader/exports/wrapper.c
+@@ -27,7 +27,7 @@
+ #endif
+ #include <dlfcn.h>
+
+-#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ typedef off_t __off_t;
+ typedef int64_t off64_t;
+ typedef off64_t __off64_t;
+--
+2.21.0
+