Android NDK r16 workaround
Removes HAVE_GETGRGID_R and HAVE_GETGRNAM_R defines since they cause
issues with newer Android NDK versions.
Bug: 771171
Change-Id: I8a613a580879ef0d579573eb04285b474c3b8a6b
diff --git a/include/arch/unix/apr_private.h b/include/arch/unix/apr_private.h
index 336f010..908ecb8 100644
--- a/include/arch/unix/apr_private.h
+++ b/include/arch/unix/apr_private.h
@@ -183,10 +183,19 @@
#define HAVE_GETENV 1
/* Define to 1 if you have the `getgrgid_r' function. */
-#define HAVE_GETGRGID_R 1
+// Removed due to incompatability with Android NDK r16
+// On older NDK versions, _POSIX_THREAD_SAFE_FUNCTIONS was unconditionally
+// #undef'd. On newer versions, it is unconditionally defined as the Posix
+// version. This causes issues in
+// user/unix/groupinfo.c, as APR seems to unconditionally define
+// HAVE_GETGRGID_R AND HAVE_GETGRNAM_R, and the only thing that was previously
+// preventing it from using getgrgid_r/getgrnam_r was
+// _POSIX_THREAD_SAFE_FUNCTIONS being undefined.
+// #define HAVE_GETGRGID_R 1
/* Define to 1 if you have the `getgrnam_r' function. */
-#define HAVE_GETGRNAM_R 1
+// Removed due to incompatability with Android NDK r16
+// #define HAVE_GETGRNAM_R 1
/* Define to 1 if you have the `gethostbyaddr_r' function. */
#define HAVE_GETHOSTBYADDR_R 1