diff options
author | Ralph Giles <giles@mozilla.com> | 2014-01-14 11:07:37 -0800 |
---|---|---|
committer | Ralph Giles <giles@mozilla.com> | 2014-01-14 11:07:37 -0800 |
commit | 4784e0717e48cd10040b29805152e84d125158c4 (patch) | |
tree | 7c90918c4fc461cdebe581d21af214288ef6a6e0 /tests | |
parent | 2c7eb787f0ff0632ff81254066b53572860f02f9 (diff) | |
download | libopus-4784e0717e48cd10040b29805152e84d125158c4.tar.gz |
Fix malloc_hook warning on glibc 2.17 and later.
In glib 2.17 the __malloc_ptr define was removed in favour
of using void* directly. Our declaration of mhook using this
type for the second argument therefore rightly generates a warning
on modern systems, since the type is assumed to be an int, which
is too narrow to hold a pointer on 64 bit architectures.
Since it was only ever a define we could use an #ifndef to define
__malloc_ptr ourselves. However we only use it once, so using void*
in the signature directly is cleaner. This should cause no problems
on older systems where it will match either the void* or the char*
(for non __STDC__ code) the define resolved to.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_opus_api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_opus_api.c b/tests/test_opus_api.c index bafe4e48..9bfa5cca 100644 --- a/tests/test_opus_api.c +++ b/tests/test_opus_api.c @@ -1753,7 +1753,7 @@ int test_repacketizer_api(void) #endif #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -typedef void *(*mhook)(size_t __size, __const __malloc_ptr_t); +typedef void *(*mhook)(size_t __size, __const void *); #endif int test_malloc_fail(void) |