1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
5 // Copyright (C) 2018-2019 Intel Corporation
8 #ifndef OPENCV_GAPI_OWN_ASSERT_HPP
9 #define OPENCV_GAPI_OWN_ASSERT_HPP
11 #if !defined(GAPI_STANDALONE)
12 #include <opencv2/core/base.hpp>
13 #define GAPI_Assert CV_Assert
14 #define GAPI_DbgAssert CV_DbgAssert
19 #include "opencv2/gapi/util/throw.hpp"
23 inline void assert_abort(const char* str, int line, const char* file, const char* func)
26 ss << file << ":" << line << ": Assertion " << str << " in function " << func << " failed\n";
27 cv::util::throw_error(std::logic_error(ss.str()));
31 #define GAPI_Assert(expr) \
32 { if (!(expr)) ::detail::assert_abort(#expr, __LINE__, __FILE__, __func__); }
36 # define GAPI_DbgAssert(expr)
38 # define GAPI_DbgAssert(expr) GAPI_Assert(expr)
41 #endif // GAPI_STANDALONE
43 #endif // OPENCV_GAPI_OWN_ASSERT_HPP