bh_assert.h 603 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _BH_ASSERT_H
  6. #define _BH_ASSERT_H
  7. #include "bh_platform.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #if BH_DEBUG != 0
  12. void
  13. bh_assert_internal(int v, const char *file_name, int line_number,
  14. const char *expr_string);
  15. #define bh_assert(expr) \
  16. bh_assert_internal((int)(uintptr_t)(expr), __FILE__, __LINE__, #expr)
  17. #else
  18. #define bh_assert(expr) (void)0
  19. #endif /* end of BH_DEBUG */
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif /* end of _BH_ASSERT_H */