sorry, right code of course is

#pragma pop_macro("NONE")
#pragma pop_macro("ERROR")

среда, 5 июля 2017 г., 20:06:40 UTC+3 пользователь Vitaliy Bondarchuk 
написал:
>
> hi guys 
>
> I switched to 0.6.1 and had to workaround 3 issues
>
> 1. imho, the best surrounding code for includes of cap'n'pro is:
> #pragma push_macro("min")
> #pragma push_macro("max")
> #pragma push_macro("VOID")
> #pragma push_macro("ERROR")
> #pragma push_macro("NONE")
> #undef NONE
> #undef VOID
> #undef ERROR
> #undef min
> #undef max
>
> #pragma warning(push)
> #pragma warning(disable: 4267; disable: 4521; disable: 4244)
>
> #include <capnp/message.h>
> #include <capnp/serialize.h>
>
> #pragma warning(pop)
>
> #pragma push_macro("NONE")
> #pragma pop_macro("ERROR")
> #pragma pop_macro("VOID")
> #pragma pop_macro("max")
> #pragma pop_macro("min")
>
> 2. had to add suppression of 4244 warning because of:
> 1>...\3rd_capnproto\c++\src\capnp\common.h(696): warning C4244: 
> 'initializing': conversion from 'unsigned __int64' to 'const capnp::uint', 
> possible loss of data
>
> constexpr uint MAX_TEXT_SIZE = kj::maxValueForBits<BLOB_SIZE_BITS>() - 1;
>
> 3. it looks like somewhy cmake doesn't include c++\src\kj\units.c++ into 
> the static library. I got linking error. As workaround I just copy-pasted 
> the piece of code from c++\src\kj\units.c++ to one of my cpp files and my 
> binary liked successfully.
> 1>capnp.lib(layout.obj) : error LNK2001: unresolved external symbol 
> "public: void __thiscall kj::ThrowOverflow::operator()(void)const " 
> (??RThrowOverflow@kj@@QBEXXZ)
>
> // === WORKAROUND BEGIN: linker somewhy doesn't find this method defined 
> in "3rd_capnproto\c++\src\kj\units.c++". may be CMAke script has error and 
> it's not in the result library?
>
> namespace kj {
>
> void ThrowOverflow::operator()() const {
> KJ_FAIL_REQUIRE("integer overflow");
> }
>
> }  // namespace kj
>
> // === WORKAROUND END:
>
>
> Hope you can fix this in next release. thanks
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to