Fix Visual Studio builds on master
Hi,
This attempts to fix the latest GJS sources from GIT master, by:
- Prefixing uses of
IN
andOUT
(andINOUT
for the sake of consistency) inGjsArgumentFlags
withARG_
, since things will clash badly with Windows SDK headers. - Overload the
bitwise OR
operator ofGjsArgumentFlags
to fix the build as Visual Studio does not like converting betweenunsigned char
andGjsArgumentFlags
directly. This is currently only done inarg-cache.cpp
.
What's outstanding for this to fix the build on Visual Studio:
I am getting this when building arg-cache.cpp
:
../../Users/fanc999/gjs/gi/arg-cache.cpp(500): error C3615: constexpr function 'Gjs::Arg::RegisteredIn::RegisteredIn' cannot result in a constant expression
../../Users/fanc999/gjs/gi/arg-cache.cpp(500): note: failure was caused by call of undefined function or one not declared 'constexpr'
../../Users/fanc999/gjs/gi/arg-cache.cpp(500): note: see usage of 'Gjs::Arg::Instance::Instance'
../../Users/fanc999/gjs/gi/arg-cache.cpp(500): note: This diagnostic occurred in the compiler generated function 'Gjs::Arg::RegisteredIn::RegisteredIn(GType,GIInfoType)'
../../Users/fanc999/gjs/gi/arg-cache.cpp(535): note: see reference to function 'Gjs::Arg::RegisteredIn::RegisteredIn(GType,GIInfoType)'
(the line 500 refers to the line using RegisteredType::RegisteredType;
as listed in the block below.
struct RegisteredIn : Instance, RegisteredType, Transferable {
using RegisteredType::RegisteredType;
GType gtype() const override { return RegisteredType::gtype(); }
};
With blessings, thank you!
Edited by Chun-wei Fan