Skip to content

gi/args.cpp: Fix build with Visual Studio

Chun-wei Fan requested to merge fix-build-msvc into master

Hi,

When calling gjs_g_argument_release_array_internal() with a GjsArgumentFlags that results from a bitwise-or of 2 GjsArgumentFlags, Visual Studio insisted that the result of that bitwise-or must be casted in order to pass into gjs_g_argument_release_array_internal().

So, this attempts to do so in order to fix the build, by copyingmaking the overload from arg-cache.cpp shared and moving the implementation of that overloaded operator up in arg-cache.cpp so that things won't become ambiguous in arg-cache.cpp., which is still needed for the latest VS 2022 as well. Sadly, I couldn't manage to add a prototype in say arg.h and just call that "function" from there, since things become ambiguous with the overloaded operator| in enum-utils.h.

With blessings, thank you!

Edited by Chun-wei Fan

Merge request reports