Browse Source

ndk: Patch malloc.h to remove clang warnings

android-5
Fredrik Fornwall 8 years ago
parent
commit
7f5da5d3af
  1. 20
      ndk_patches/malloc.h.patch
  2. 2
      packages/ndk-sysroot/build.sh

20
ndk_patches/malloc.h.patch

@ -0,0 +1,20 @@
diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/malloc.h ./usr/include/malloc.h
--- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/malloc.h 2016-09-29 14:42:26.000000000 +0200
+++ ./usr/include/malloc.h 2017-01-19 02:48:15.961754659 +0100
@@ -27,12 +27,12 @@
__BEGIN_DECLS
-extern void* malloc(size_t byte_count) __mallocfunc __wur __attribute__((alloc_size(1)));
-extern void* calloc(size_t item_count, size_t item_size) __mallocfunc __wur __attribute__((alloc_size(1,2)));
-extern void* realloc(void* p, size_t byte_count) __wur __attribute__((alloc_size(2)));
+extern void* malloc(size_t byte_count) __mallocfunc __wur;
+extern void* calloc(size_t item_count, size_t item_size) __mallocfunc __wur;
+extern void* realloc(void* p, size_t byte_count) __wur;
extern void free(void* p);
-extern void* memalign(size_t alignment, size_t byte_count) __mallocfunc __wur __attribute__((alloc_size(2)));
+extern void* memalign(size_t alignment, size_t byte_count) __mallocfunc __wur;
extern size_t malloc_usable_size(const void* p);
#ifndef STRUCT_MALLINFO_DECLARED

2
packages/ndk-sysroot/build.sh

@ -1,7 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
TERMUX_PKG_DESCRIPTION="System header and library files from the Android NDK needed for compiling C programs" TERMUX_PKG_DESCRIPTION="System header and library files from the Android NDK needed for compiling C programs"
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
TERMUX_PKG_REVISION=6 TERMUX_PKG_REVISION=7
TERMUX_PKG_NO_DEVELSPLIT=yes TERMUX_PKG_NO_DEVELSPLIT=yes
# Depend on libandroid-support-dev so that iconv.h and libintl.h are available: # Depend on libandroid-support-dev so that iconv.h and libintl.h are available:
TERMUX_PKG_DEPENDS="libandroid-support-dev" TERMUX_PKG_DEPENDS="libandroid-support-dev"

Loading…
Cancel
Save