From b737531c1b96ad2655b4e7fb3067e4913ca9c7ab Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 6 Feb 2018 17:16:53 -0800 Subject: Remove posix_memalign from libandroid_support. This function is now available in all supported API levels. Test: ./checkbuild.py && ./run_tests.py Bug: None Change-Id: I209789d36e1e06a4edc4beb7050a8063f359a5ca --- sources/android/support/Android.mk | 1 - sources/android/support/include/stdlib.h | 4 ---- sources/android/support/src/posix_memalign.cpp | 20 -------------------- 3 files changed, 25 deletions(-) delete mode 100644 sources/android/support/src/posix_memalign.cpp (limited to 'sources') diff --git a/sources/android/support/Android.mk b/sources/android/support/Android.mk index d0e0060db..89ba793bb 100644 --- a/sources/android/support/Android.mk +++ b/sources/android/support/Android.mk @@ -104,7 +104,6 @@ android_support_sources := \ $(BIONIC_PATH)/libm/upstream-freebsd/lib/msun/src/s_tan.c \ $(BIONIC_PATH)/libm/upstream-freebsd/lib/msun/src/s_tanh.c \ src/locale_support.cpp \ - src/posix_memalign.cpp \ src/swprintf.cpp \ src/wcstox.cpp \ diff --git a/sources/android/support/include/stdlib.h b/sources/android/support/include/stdlib.h index b0cc57974..a6895d6a8 100644 --- a/sources/android/support/include/stdlib.h +++ b/sources/android/support/include/stdlib.h @@ -33,10 +33,6 @@ __BEGIN_DECLS -#if __ANDROID_API__ < __ANDROID_API_J__ -int posix_memalign(void** memptr, size_t alignment, size_t size); -#endif - #if __ANDROID_API__ < __ANDROID_API_L__ #undef MB_CUR_MAX size_t __ctype_get_mb_cur_max(void); diff --git a/sources/android/support/src/posix_memalign.cpp b/sources/android/support/src/posix_memalign.cpp deleted file mode 100644 index cf7abbbf5..000000000 --- a/sources/android/support/src/posix_memalign.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include - -int posix_memalign(void** memptr, size_t alignment, size_t size) { - if ((alignment & (alignment - 1)) != 0 || alignment == 0) { - return EINVAL; - } - - if (alignment % sizeof(void*) != 0) { - return EINVAL; - } - - *memptr = memalign(alignment, size); - if (*memptr == NULL) { - return errno; - } - - return 0; -} -- cgit v1.2.3