Fixes android werror failures:
../plugins/elements/gstfdsrc.c:244:25: error: incompatible pointer types passing 'struct stat *' to parameter of type 'struct stat64 *' [-Werror,-Wincompatible-pointer-types]
if (fstat (src->fd, &stat_results) < 0)
^~~~~~~~~~~~~
/home/matt/Projects/cerbero/build/android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
^
../plugins/elements/gstfdsrc.c:560:23: error: incompatible pointer types passing 'struct stat *' to parameter of type 'struct stat64 *' [-Werror,-Wincompatible-pointer-types]
if (fstat (src->fd, &stat_results) < 0)
^~~~~~~~~~~~~
/home/matt/Projects/cerbero/build/android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
^
if (fstat (fd, &stat_results) < 0)
^~~~~~~~~~~~~
/home/matt/Projects/cerbero/build/android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
^
if (fstat (src->fd, &stat_results) < 0)
^~~~~~~~~~~~~
../../../../../android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
^
../plugins/elements/gstfilesrc.c:477:23: error: incompatible pointer types passing 'struct stat *' to parameter of type 'struct stat64 *' [-Werror,-Wincompatible-pointer-types]
if (fstat (src->fd, &stat_results) < 0)
^~~~~~~~~~~~~
../../../../../android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
^
#define off_t guint64
#endif
+#define struct_stat struct stat
+
#if defined(__BIONIC__) /* Android */
#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21
#undef fstat
#define fstat fstat64
+#undef struct_stat
+#define struct_stat struct stat64
#endif
#endif
static gboolean
gst_fd_sink_check_fd (GstFdSink * fdsink, int fd, GError ** error)
{
- struct stat stat_results;
+ struct_stat stat_results;
off_t result;
/* see that it is a valid file descriptor */
#include "gstfdsrc.h"
+#define struct_stat struct stat
+
#ifdef __BIONIC__ /* Android */
#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21
#undef fstat
#define fstat fstat64
+#undef struct_stat
+#define struct_stat struct stat64
#endif
#endif
static void
gst_fd_src_update_fd (GstFdSrc * src, guint64 size)
{
- struct stat stat_results;
+ struct_stat stat_results;
GST_DEBUG_OBJECT (src, "fdset %p, old_fd %d, new_fd %d", src->fdset, src->fd,
src->new_fd);
gst_fd_src_get_size (GstBaseSrc * bsrc, guint64 * size)
{
GstFdSrc *src = GST_FD_SRC (bsrc);
- struct stat stat_results;
+ struct_stat stat_results;
if (src->size != -1) {
*size = src->size;
# include <unistd.h>
#endif
+#define struct_stat struct stat
+
#ifdef __BIONIC__ /* Android */
#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21
#undef fstat
#define fstat fstat64
+#undef struct_stat
+#define struct_stat struct stat64
#endif
#endif
static gboolean
gst_file_src_get_size (GstBaseSrc * basesrc, guint64 * size)
{
- struct stat stat_results;
+ struct_stat stat_results;
GstFileSrc *src;
src = GST_FILE_SRC (basesrc);
gst_file_src_start (GstBaseSrc * basesrc)
{
GstFileSrc *src = GST_FILE_SRC (basesrc);
- struct stat stat_results;
+ struct_stat stat_results;
if (src->filename == NULL || src->filename[0] == '\0')
goto no_filename;