shithub: opus

Download patch

ref: c19bc346386544574bae65e7979ae94603688496
parent: ed90cdc36903796752a89a789ef21f38306f230f
author: Ralph Giles <[email protected]>
date: Fri Oct 28 03:14:58 EDT 2011

Check for __malloc_hook and define MALLOC_FAIL appropriately.

The glibc 2.14 NEWS file says __malloc_hook will be removed
in the next release, so future-proof our use by checking
for this symbol at configure time and only compiling the
malloc failure tests if it is present.

--- a/configure.ac
+++ b/configure.ac
@@ -185,6 +185,7 @@
 
 AC_CHECK_FUNCS([lrintf])
 AC_CHECK_FUNCS([lrint])
+AC_CHECK_FUNCS([__malloc_hook])
 
 AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(int)
--- a/tests/test_opus_api.c
+++ b/tests/test_opus_api.c
@@ -61,7 +61,7 @@
 #define VG_CHECK(x,y)
 #endif
 
-#ifdef __GLIBC__
+#if defined(__GLIBC__) && defined(HAVE___MALLOC_HOOK)
 #define MALLOC_FAIL
 #include "os_support.h"
 #include <malloc.h>