osdep: make use of HAVE_ANDROID

This commit is contained in:
Tom Yan 2018-07-21 16:39:11 +08:00 committed by sfan5
parent d48786f682
commit d4bbfb8453
3 changed files with 8 additions and 4 deletions

View File

@ -33,7 +33,7 @@
#include <glob.h> #include <glob.h>
#endif #endif
#ifdef __ANDROID__ #if HAVE_ANDROID
# include <unistd.h> # include <unistd.h>
# include <stdio.h> # include <stdio.h>
@ -58,7 +58,7 @@ static inline int mp_fseeko(FILE* fp, off64_t offset, int whence) {
} }
#define fseeko(f,p,w) mp_fseeko((f), (p), (w)) #define fseeko(f,p,w) mp_fseeko((f), (p), (w))
#endif // __ANDROID__ #endif // HAVE_ANDROID
#ifndef O_BINARY #ifndef O_BINARY
#define O_BINARY 0 #define O_BINARY 0

View File

@ -19,7 +19,9 @@
#pragma once #pragma once
#ifdef __ANDROID__ #include "config.h"
#if HAVE_ANDROID
// posix_spawn(p) does not exist at all on Android // posix_spawn(p) does not exist at all on Android
#include "osdep/android/posix-spawn.h" #include "osdep/android/posix-spawn.h"
#else #else

View File

@ -20,7 +20,9 @@
#ifndef MP_OSDEP_STRNLEN #ifndef MP_OSDEP_STRNLEN
#define MP_OSDEP_STRNLEN #define MP_OSDEP_STRNLEN
#ifdef __ANDROID__ #include "config.h"
#if HAVE_ANDROID
// strnlen is broken on current android ndk, see https://code.google.com/p/android/issues/detail?id=74741 // strnlen is broken on current android ndk, see https://code.google.com/p/android/issues/detail?id=74741
#include "osdep/android/strnlen.h" #include "osdep/android/strnlen.h"
#define strnlen freebsd_strnlen #define strnlen freebsd_strnlen