diff options
Diffstat (limited to 'src/lib/openjp2/opj_malloc.c')
| -rw-r--r-- | src/lib/openjp2/opj_malloc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/openjp2/opj_malloc.c b/src/lib/openjp2/opj_malloc.c index a4aea30f..939d8282 100644 --- a/src/lib/openjp2/opj_malloc.c +++ b/src/lib/openjp2/opj_malloc.c @@ -49,7 +49,7 @@ static INLINE void *opj_aligned_alloc_n(size_t alignment, size_t size) return NULL; } -#if defined(HAVE_POSIX_MEMALIGN) +#if defined(OPJ_HAVE_POSIX_MEMALIGN) /* aligned_alloc requires c11, restrict to posix_memalign for now. Quote: * This function was introduced in POSIX 1003.1d. Although this function is * superseded by aligned_alloc, it is more portable to older POSIX systems @@ -59,10 +59,10 @@ static INLINE void *opj_aligned_alloc_n(size_t alignment, size_t size) ptr = NULL; } /* older linux */ -#elif defined(HAVE_MEMALIGN) +#elif defined(OPJ_HAVE_MEMALIGN) ptr = memalign( alignment, size ); /* _MSC_VER */ -#elif defined(HAVE__ALIGNED_MALLOC) +#elif defined(OPJ_HAVE__ALIGNED_MALLOC) ptr = _aligned_malloc(size, alignment); #else /* @@ -114,7 +114,7 @@ static INLINE void *opj_aligned_realloc_n(void *ptr, size_t alignment, size_t ne } /* no portable aligned realloc */ -#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN) +#if defined(OPJ_HAVE_POSIX_MEMALIGN) || defined(OPJ_HAVE_MEMALIGN) /* glibc doc states one can mixed aligned malloc with realloc */ r_ptr = realloc( ptr, new_size ); /* fast path */ /* we simply use `size_t` to cast, since we are only interest in binary AND @@ -132,7 +132,7 @@ static INLINE void *opj_aligned_realloc_n(void *ptr, size_t alignment, size_t ne r_ptr = a_ptr; } /* _MSC_VER */ -#elif defined(HAVE__ALIGNED_MALLOC) +#elif defined(OPJ_HAVE__ALIGNED_MALLOC) r_ptr = _aligned_realloc( ptr, new_size, alignment ); #else if (ptr == NULL) { @@ -210,9 +210,9 @@ void * opj_aligned_realloc(void *ptr, size_t size) void opj_aligned_free(void* ptr) { -#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN) +#if defined(OPJ_HAVE_POSIX_MEMALIGN) || defined(OPJ_HAVE_MEMALIGN) free( ptr ); -#elif defined(HAVE__ALIGNED_MALLOC) +#elif defined(OPJ_HAVE__ALIGNED_MALLOC) _aligned_free( ptr ); #else /* Generic implementation has malloced pointer stored in front of used area */ |
