-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Request - Do not expose "check" identifier #17261
Description
System information (version)
- OpenCV => 4.3
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2019
Detailed description
OpenCV cannot be included in a UE4(Unreal Engined) project. (Tested with UE4 4.24)
This is due to the check() functions in modules/core/include/opencv2/core/utility.hpp and in modules/core/include/opencv2/core/cvstd_wrapper.hpp and several other files.
UE4 defines the macro check() to be used for assertions. This is deeply integrated into their workflow and probably cannot be changed.
The macro collides with the check() functions.
According to a warning generated on line 52 of utility.hpp, the same issue occurs when using Apple headers.
As this is an issue that now appears when using 2 different major codebases, I suggest avoiding exposing the "check" identifier.
For the existing functions, e.g. in utility.hpp and in cvstd_wrapper.hpp we can alter the name to cv_check().
Steps to reproduce
Include OpenCV 4.3.0 in a UE4 4.24 game and try building.
An example of one of the errors that will be generated:
ThirdParty\opencv\include\opencv2\core\cvstd_wrapper.hpp(45): error C4002: too many arguments for function-like macro invocation 'check'
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
answers.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc