Fix building when configured with --disable-shared.

The problem was that the function safe_malloc_mul_2op_() was originally
defined as static inline in inclide/share/alloc.h but had to be moved
because GCC was refusing to inline it. Once moved however, static linking
would fail when building the flac executable because the function ended
up beiong linked twice.
This commit is contained in:
Erik de Castro Lopo
2012-06-22 14:23:56 +10:00
parent feab11e9bd
commit 8749dc278d
7 changed files with 19 additions and 9 deletions

View File

@@ -142,7 +142,9 @@ static inline void *safe_malloc_muladd2_(size_t size1, size_t size2, size_t size
size2 += size3;
if(size2 < size3)
return 0;
return safe_malloc_mul_2op_(size1, size2);
if(size1 > SIZE_MAX / size2)
return 0;
return malloc(size1*size2);
}
static inline void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2)