Closed BRomans closed 4 months ago
The C++ standard mandates that integers get implicitly promoted booleans.
Could you paste the error messages you are getting without this workaround?
I thought so too but here what I get
[1/6] Compile [x64] MySystem.cpp MyProject\Plugins\lsl\Include\lsl_cpp.h(327): error C4800: Implicit conversion from 'int32_t' to bool. Possible information loss MyProject\Plugins\lsl\Include\lsl_cpp.h(327): note: consider using explicit cast or comparison to 0 to avoid this warning C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\INCLUDE\stdint.h(20): note: see declaration of 'int32_t'
It says it's a warning but it does not let me compile the Unreal Engine project I am working on.
Did you or the build environment set "Treat warnings as errors" or the /WX
flag?
I pushed a shorter workaround that should remove the warning for MSVC.
It was all the presets of the build environment
When importing the native library into Unreal Engine (not the plugin) the implicit conversion from int to bool would crash the build. With explicit conversion the build succeeds and the functionality is preserved.