diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-02-28 08:41:57 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-02-28 08:42:28 +0200 |
commit | 757856e9275d19e2c7a3673d10fa8963fb9fbeb3 (patch) | |
tree | 5f5a36e8a66b71942ae69257ca063f1ee3a92c9e /sal | |
parent | 2dcc6a491a308b65172b509e895942d8b1b9c536 (diff) |
Android does not have posix_memalign()
Change-Id: I4cd2f1e41b3bcab0d87a7b353d63c04b20aad492
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/memory.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sal/osl/unx/memory.c b/sal/osl/unx/memory.c index a70bc164f0e5..2b6c20f47d1c 100644 --- a/sal/osl/unx/memory.c +++ b/sal/osl/unx/memory.c @@ -10,12 +10,19 @@ #include <internal/oslmemory.h> #include <stdlib.h> +#ifdef __ANDROID__ +#include <malloc.h> +#endif void* osl_aligned_alloc( sal_Size align, sal_Size size ) { +#ifdef __ANDROID__ + return memalign(align, size); +#else void* ptr; int err = posix_memalign(&ptr, align, size); return err ? NULL : ptr; +#endif } void osl_aligned_free( void* p ) |