Commit 9edb817d authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

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).
parent 06f3812d
......@@ -1047,3 +1047,16 @@ FLAC__bool FLAC__bitreader_read_utf8_uint64(FLAC__BitReader *br, FLAC__uint64 *v
*val = v;
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__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br);
extern unsigned FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br);
extern unsigned FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br);
extern FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val);
......@@ -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);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment