mirror of
https://github.com/xiph/opus.git
synced 2025-05-15 16:08:30 +00:00
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.
This commit is contained in:
parent
2c7eb787f0
commit
4784e0717e
1 changed files with 1 additions and 1 deletions
|
@ -1753,7 +1753,7 @@ int test_repacketizer_api(void)
|
||||||
#endif
|
#endif
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
#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
|
#endif
|
||||||
|
|
||||||
int test_malloc_fail(void)
|
int test_malloc_fail(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue