diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2012-06-22 14:23:56 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2012-06-22 14:23:56 +1000 |
commit | 8749dc278d7c48099cdbdb092be386ab855f78e3 (patch) | |
tree | dfacf8f543caa9c2a6101cdd92a1e50a4b78e1f8 /src/libFLAC/metadata_object.c | |
parent | feab11e9bdf2e95e590ab12cb4ec30232bdd1ed3 (diff) | |
download | flac-8749dc278d7c48099cdbdb092be386ab855f78e3.tar.gz |
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.
Diffstat (limited to 'src/libFLAC/metadata_object.c')
-rw-r--r-- | src/libFLAC/metadata_object.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libFLAC/metadata_object.c b/src/libFLAC/metadata_object.c index 7f178f81..149f78de 100644 --- a/src/libFLAC/metadata_object.c +++ b/src/libFLAC/metadata_object.c @@ -37,10 +37,14 @@ #include <string.h> #include "private/metadata.h" +#include "private/memory.h" #include "FLAC/assert.h" #include "share/alloc.h" +/* Alias the first (in share/alloc.h) to the second (in src/libFLAC/memory.c). */ +#define safe_malloc_mul_2op_ safe_malloc_mul_2op_p + /**************************************************************************** * @@ -151,7 +155,7 @@ static FLAC__bool copy_track_(FLAC__StreamMetadata_CueSheet_Track *to, const FLA else { FLAC__StreamMetadata_CueSheet_Index *x; FLAC__ASSERT(from->num_indices > 0); - if(0 == (x = safe_malloc_mul_2op_(from->num_indices, /*times*/sizeof(FLAC__StreamMetadata_CueSheet_Index)))) + if(0 == (x = safe_malloc_mul_2op_p(from->num_indices, /*times*/sizeof(FLAC__StreamMetadata_CueSheet_Index)))) return false; memcpy(x, from->indices, from->num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index)); to->indices = x; @@ -173,7 +177,7 @@ static FLAC__StreamMetadata_SeekPoint *seekpoint_array_new_(unsigned num_points) FLAC__ASSERT(num_points > 0); - object_array = safe_malloc_mul_2op_(num_points, /*times*/sizeof(FLAC__StreamMetadata_SeekPoint)); + object_array = safe_malloc_mul_2op_p(num_points, /*times*/sizeof(FLAC__StreamMetadata_SeekPoint)); if(0 != object_array) { unsigned i; |