Commit ccb3a601 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix [24726]

parent b813408a
...@@ -109,22 +109,14 @@ ...@@ -109,22 +109,14 @@
* void *vlc_memalign( size_t align, size_t size, void **pp_orig ) * void *vlc_memalign( size_t align, size_t size, void **pp_orig )
* *pp_orig is the pointer that has to be freed afterwards. * *pp_orig is the pointer that has to be freed afterwards.
*/ */
#if defined (HAVE_POSIX_MEMALIGN)
static inline static inline
void *vlc_memalign (size_t align, size_t size, void **pp) void *vlc_memalign (void **pp, size_t align, size_t size)
{ {
#if defined (HAVE_POSIX_MEMALIGN)
return posix_memalign (pp, align, size) ? NULL : *pp; return posix_memalign (pp, align, size) ? NULL : *pp;
}
#elif defined (HAVE_MEMALIGN) #elif defined (HAVE_MEMALIGN)
static inline
void *vlc_memalign (size_t align, size_t size, void **pp)
{
return *pp = memalign (align, size); return *pp = memalign (align, size);
} #else
#else /* We don't have any choice but to align manually */
static inline
void *vlc_memalign (size_t align, size_t size, void **pp)
{
unsigned char *ptr; unsigned char *ptr;
if (align < 1) if (align < 1)
...@@ -138,6 +130,6 @@ void *vlc_memalign (size_t align, size_t size, void **pp) ...@@ -138,6 +130,6 @@ void *vlc_memalign (size_t align, size_t size, void **pp)
*pp = ptr; *pp = ptr;
ptr += align; ptr += align;
return (void *)(((uintptr_t)ptr) & ~align); return (void *)(((uintptr_t)ptr) & ~align);
}
#endif #endif
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment