bh_assert.h 649 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 bh_assert_internal(int v, const char *file_name, int line_number,
  13. const char *expr_string);
  14. #define bh_assert(expr) bh_assert_internal((int)(uintptr_t)(expr), \
  15. __FILE__, __LINE__, #expr)
  16. #else
  17. #define bh_assert(expr) (void)0
  18. #endif /* end of BH_DEBUG */
  19. #ifdef __cplusplus
  20. }
  21. #endif
  22. #endif /* end of _BH_ASSERT_H */