diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-03-12 17:08:29 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-03-12 17:12:07 +1100 |
commit | 9edb817dd2c35ccea73696557d52ddc1fee171d3 (patch) | |
tree | 35f3bfabc335860b825da10201666ce9d49acead /src/libFLAC/bitwriter.c | |
parent | 06f3812d79d84c9116ce2f966aca8208ea171cbf (diff) | |
download | flac-9edb817dd2c35ccea73696557d52ddc1fee171d3.tar.gz |
MS VS inline/extern fix from Ben Alison plus comments.
Add explicit extern to functions that are locally declared inline
but which also have non-inline public prototypes.
It seems MS VS does not quite meet the C99 spec (section 6.7.4).
Diffstat (limited to 'src/libFLAC/bitwriter.c')
-rw-r--r-- | src/libFLAC/bitwriter.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libFLAC/bitwriter.c b/src/libFLAC/bitwriter.c index 7d61d730..9b15affd 100644 --- a/src/libFLAC/bitwriter.c +++ b/src/libFLAC/bitwriter.c @@ -848,3 +848,16 @@ FLAC__bool FLAC__bitwriter_zero_pad_to_byte_boundary(FLAC__BitWriter *bw) else return true; } + +/* These functions a declared inline in this file but are also callable as + * externs from elsewhere. + * According to the C99 sepc, section 6.7.4, simply providing a function + * prototype in a header file without 'inline' and making the function inline + * in this file should be sufficient. + * Unfortunately, the Microsoft VS compiler doesn't pick them up externally. To + * fix that we add extern declarations here. + */ +extern FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, unsigned bits); +extern FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, unsigned bits); +extern FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val); +extern FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], unsigned nvals); |