2018-03-07 20:57:14 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
|
|
*
|
2018-05-26 01:49:13 +08:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2018-03-07 20:57:14 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ASSERT_H
|
|
|
|
#define ASSERT_H
|
|
|
|
|
|
|
|
#ifdef HV_DEBUG
|
2018-07-09 21:20:50 +08:00
|
|
|
void __assert(int32_t line, const char *file, const char *txt);
|
2018-03-07 20:57:14 +08:00
|
|
|
|
|
|
|
#define ASSERT(x, ...) \
|
|
|
|
if (!(x)) {\
|
|
|
|
__assert(__LINE__, __FILE__, "fatal error");\
|
|
|
|
}
|
|
|
|
#else
|
2018-03-25 17:44:20 +08:00
|
|
|
#define ASSERT(x, ...) do { } while(0)
|
2018-03-07 20:57:14 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ASSERT_H */
|