Skip to content

Simplify "extern inlines" in bitreader and bitwriter#905

Open
solbjorn wants to merge 1 commit into
xiph:masterfrom
solbjorn:simplify-extern-inlines
Open

Simplify "extern inlines" in bitreader and bitwriter#905
solbjorn wants to merge 1 commit into
xiph:masterfrom
solbjorn:simplify-extern-inlines

Conversation

@solbjorn

Copy link
Copy Markdown

Extern inlines are not clearly defined by the C standard and are often interpreted differently depending in the compiler. These ones already involve workarounds for MSVC.
Clang under certain optimization options (LTO etc.) also doesn't intepret this correctly and doesn't emit standalone symbols for those at all, leading to linking errors.

Simplify these by defining plain static inlines to be used within the corresponding files and separate global symbols to be used externally. This doesn't make the codegen worse for bitreader and bitwriter, but guarantees that the global symbols will always be defined regardless of the compiler and compilation options.

Closes #895.

Extern inlines are not clearly defined by the C standard and are
often interpreted differently depending in the compiler. These
ones already involve workarounds for MSVC.
Clang under certain optimization options (LTO etc.) also doesn't
intepret this correctly and doesn't emit standalone symbols for
those at all, leading to linking errors.

Simplify these by defining plain static inlines to be used within
the corresponding files and separate global symbols to be used
externally. This doesn't make the codegen worse for bitreader
and bitwriter, but guarantees that the global symbols will always
be defined regardless of the compiler and compilation options.

Closes xiph#895.

Signed-off-by: Alexander Lobakin <alobakin@mailbox.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows/clang-cl: error linking static FLAC.lib

1 participant