Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: nspr/pr/src/md/unix/unix.c

Issue 408583002: Fix for Android >= api level 19. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/md/unix/unix.c
===================================================================
--- nspr/pr/src/md/unix/unix.c (revision 257452)
+++ nspr/pr/src/md/unix/unix.c (working copy)
@@ -30,6 +30,10 @@
#include <sys/statvfs.h>
#endif
+#if defined(ANDROID)
+#include <android/api-level.h>
+#endif
+
/*
* Make sure _PRSockLen_t is 32-bit, because we will cast a PRUint32* or
* PRInt32* pointer to a _PRSockLen_t* pointer.
@@ -2709,8 +2713,9 @@
} /* _MD_Unix_mmap64 */
#endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */
-/* Android doesn't have mmap64. */
#if defined(ANDROID)
+/* Android <= 19 doesn't have mmap64. */
+#if __ANDROID_API__ <= 19
extern void *__mmap2(void *, size_t, int, int, int, size_t);
#define ANDROID_PAGE_SIZE 4096
@@ -2724,7 +2729,8 @@
}
return __mmap2(addr, len, prot, flags, fd, offset / ANDROID_PAGE_SIZE);
}
-#endif
+#endif // __ANDROID_API__ <= 19
+#endif // defined(ANDROID)
wtc 2014/07/22 23:45:12 Nit: use pre-C99 /* */ comment delimiters in this
#if defined(OSF1) && defined(__GNUC__)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698