From 82703204a97988d2b39714c4e0cb879506a3e23f Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 24 Oct 2013 19:39:13 +0200 Subject: [PATCH] ndk: Add missing declaration for mkdtemp The mkdtemp() function has always been implemented in the C library (see [1] for proof) but was missing a declaration in , until Android 4.0.1 [2] This patch simply adds the missing declaration to former versions. This makes it easier to build certain open-source programs for Android, because auto-tools probing typically looks at the symbols in libc.so to define HAVE_MKDTEMP, then the source fails to compile because of the lack of declaration. Note that the mkdtemp is also already listed in platforms/android-*/arch-*/symbols/libc.so.functions.txt, which were generated by parsing actual system libraries, and thus don't need to be updated here. [1] https://android.googlesource.com/platform/bionic/+/android-1.6_r1/libc/stdio/mktemp.c https://android.googlesource.com/platform/bionic/+/android-1.6_r1/libc/Android.mk [2] https://android.googlesource.com/platform/bionic/+/ad1ff2fb268034074488f0b4b30b5311008b8617 Change-Id: I838b54bcb5cbfd2fed24cf7649897889ec7a5559 --- ndk/platforms/android-3/include/stdlib.h | 1 + ndk/platforms/android-8/include/stdlib.h | 1 + ndk/platforms/android-9/include/stdlib.h | 1 + 3 files changed, 3 insertions(+) diff --git a/ndk/platforms/android-3/include/stdlib.h b/ndk/platforms/android-3/include/stdlib.h index ecb330f7d..bb5b3b8d9 100644 --- a/ndk/platforms/android-3/include/stdlib.h +++ b/ndk/platforms/android-3/include/stdlib.h @@ -56,6 +56,7 @@ extern int putenv(const char *); extern int setenv(const char *, const char *, int); extern int unsetenv(const char *); +extern char *mkdtemp(char *); extern char *mktemp (char *); extern int mkstemp (char *); diff --git a/ndk/platforms/android-8/include/stdlib.h b/ndk/platforms/android-8/include/stdlib.h index a34b38128..e89db5666 100644 --- a/ndk/platforms/android-8/include/stdlib.h +++ b/ndk/platforms/android-8/include/stdlib.h @@ -57,6 +57,7 @@ extern int setenv(const char *, const char *, int); extern int unsetenv(const char *); extern int clearenv(void); +extern char *mkdtemp(char *); extern char *mktemp (char *); extern int mkstemp (char *); diff --git a/ndk/platforms/android-9/include/stdlib.h b/ndk/platforms/android-9/include/stdlib.h index bc714f45b..601178771 100644 --- a/ndk/platforms/android-9/include/stdlib.h +++ b/ndk/platforms/android-9/include/stdlib.h @@ -57,6 +57,7 @@ extern int setenv(const char *, const char *, int); extern int unsetenv(const char *); extern int clearenv(void); +extern char *mkdtemp(char *); extern char *mktemp (char *); extern int mkstemp (char *);