Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-30 08:46:14

0001 /*
0002     Copyright (c) 2005-2022 Intel Corporation
0003 
0004     Licensed under the Apache License, Version 2.0 (the "License");
0005     you may not use this file except in compliance with the License.
0006     You may obtain a copy of the License at
0007 
0008         http://www.apache.org/licenses/LICENSE-2.0
0009 
0010     Unless required by applicable law or agreed to in writing, software
0011     distributed under the License is distributed on an "AS IS" BASIS,
0012     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013     See the License for the specific language governing permissions and
0014     limitations under the License.
0015 */
0016 
0017 #ifndef __TBB_detail__assert_H
0018 #define __TBB_detail__assert_H
0019 
0020 #include "_config.h"
0021 
0022 #if __TBBMALLOC_BUILD
0023 namespace rml { namespace internal {
0024 #else
0025 namespace tbb {
0026 namespace detail {
0027 namespace r1 {
0028 #endif
0029 //! Process an assertion failure.
0030 /** Normally called from __TBB_ASSERT macro.
0031   If assertion handler is null, print message for assertion failure and abort.
0032   Otherwise call the assertion handler. */
0033 TBB_EXPORT void __TBB_EXPORTED_FUNC assertion_failure(const char* location, int line, const char* expression, const char* comment);
0034 #if __TBBMALLOC_BUILD
0035 }} // namespaces rml::internal
0036 #else
0037 } // namespace r1
0038 } // namespace detail
0039 } // namespace tbb
0040 #endif
0041 
0042 #if __TBBMALLOC_BUILD
0043 //! Release version of assertions
0044 #define __TBB_ASSERT_RELEASE(predicate,message) ((predicate)?((void)0) : rml::internal::assertion_failure(__func__,__LINE__,#predicate,message))
0045 #else
0046 #define __TBB_ASSERT_RELEASE(predicate,message) ((predicate)?((void)0) : tbb::detail::r1::assertion_failure(__func__,__LINE__,#predicate,message))
0047 #endif
0048 
0049 #if TBB_USE_ASSERT
0050     //! Assert that predicate is true.
0051     /** If predicate is false, print assertion failure message.
0052         If the comment argument is not nullptr, it is printed as part of the failure message.
0053         The comment argument has no other effect. */
0054     #define __TBB_ASSERT(predicate,message) __TBB_ASSERT_RELEASE(predicate,message)
0055     //! "Extended" version
0056     #define __TBB_ASSERT_EX __TBB_ASSERT
0057 #else
0058     //! No-op version of __TBB_ASSERT.
0059     #define __TBB_ASSERT(predicate,comment) ((void)0)
0060     //! "Extended" version is useful to suppress warnings if a variable is only used with an assert
0061     #define __TBB_ASSERT_EX(predicate,comment) ((void)(1 && (predicate)))
0062 #endif // TBB_USE_ASSERT
0063 
0064 #endif // __TBB_detail__assert_H