From b29ec8d981e3ad1320313e0b32d36717dc2fc577 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Mon, 11 Apr 2016 09:15:57 -0400 Subject: [PATCH] stdio.h: Avoid pulling in complete fcntl.h This pollutes the namespace and breaks building e.g. python, which defines a tee() function. --- ndk_patches/stdio.h.patch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ndk_patches/stdio.h.patch b/ndk_patches/stdio.h.patch index 600c79e1a..c64fda156 100644 --- a/ndk_patches/stdio.h.patch +++ b/ndk_patches/stdio.h.patch @@ -6,7 +6,7 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/incl #include +#include /* For strcpy(3) used by ctermid() */ -+#include /* For O_RDWR and other O_* constants */ ++#include /* For O_RDWR and other O_* constants */ +#include /* For arc4random() */ + #define __need_NULL @@ -46,12 +46,15 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/incl #if defined(__BIONIC_FORTIFY) __BEGIN_DECLS -@@ -462,4 +474,26 @@ +@@ -462,4 +474,29 @@ #endif /* defined(__BIONIC_FORTIFY) */ +__BEGIN_DECLS + ++extern int open(const char*, int, ...); ++extern pid_t getpid(); ++extern int unlink(const char*); +static FILE* tmpfile() { + int p = getpid(); + char* path;