1 /*========================== begin_copyright_notice ============================ 2 3 Copyright (C) 2020-2021 Intel Corporation 4 5 SPDX-License-Identifier: MIT 6 7 ============================= end_copyright_notice ===========================*/ 8 9 #ifndef IGC_PROBE_ASSERTION_H 10 #define IGC_PROBE_ASSERTION_H 11 12 #include "../common/EmUtils.h" 13 14 15 #include <cassert> 16 #include <cstdlib> 17 18 #define IGC_ASSERT assert 19 20 #define IGC_ASSERT_MESSAGE(x, m, ...) IGC_ASSERT(x) 21 22 #define IGC_ASSERT_EXIT(x) \ 23 do \ 24 { \ 25 if(0 == (x)) \ 26 { \ 27 assert(0); \ 28 std::exit(EXIT_FAILURE); \ 29 } \ 30 } while(0) 31 32 #define IGC_ASSERT_EXIT_MESSAGE(x, m, ...) IGC_ASSERT_EXIT(x) 33 34 35 #endif // IGC_PROBE_ASSERTION_H 36