Fix build failures on Linux and Windows #42
Open
navidicted wants to merge 4 commits intosjoenk:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves build issues on both Linux and Windows when compiling the plugin with newer compilers.
Changes Included
1. Linux Build Fix
G_DEFINE_TYPEmacro fails when the required class and instance types are not declared beforehand. This results in undefined type errors and prevents the plugin from building correctly, potentially leading to aMissingPluginExceptionat runtime.typedefdeclarations for_AudioDecoderPluginand_AudioDecoderPluginClassbefore the struct definitions so the macro can resolve the types correctly.2. Windows Build Fix
minandmaxmacros via<windows.h>, which conflict withstd::minandstd::max, causingC2589andC2059compilation errors.C4245warning caused by an implicit conversion when passingMF_SOURCE_READER_MEDIASOURCEto aDWORD.flutter::EncodableMapandflutter::EncodableListtypes no longer transitively included viastandart_method_codec.hand without fix it gives compilation error.std::tolowerreturnsint, assignment tocharcaused possible data loss warning.std::minandstd::maxcalls in parentheses (e.g.(std::min)(...)) to avoid macro expansion conflicts.static_cast<DWORD>forMF_SOURCE_READER_MEDIASOURCEto match the expected type.audio_decoder_plugin.hchar, useunsigned charinput to avoidd undefined behaviour for negativecharvalues.Environment Tested