bh_platform.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _BH_PLATFORM_H
  6. #define _BH_PLATFORM_H
  7. #include "../platform/include/platform_common.h"
  8. #include "../platform/include/platform_api_vmcore.h"
  9. #include "../platform/include/platform_api_extension.h"
  10. #include "bh_assert.h"
  11. #include "bh_common.h"
  12. #include "bh_hashmap.h"
  13. #include "bh_list.h"
  14. #include "bh_log.h"
  15. #include "bh_queue.h"
  16. #include "bh_vector.h"
  17. #include "runtime_timer.h"
  18. /**
  19. * WA_MALLOC/WA_FREE need to be redefined for both
  20. * runtime native and WASM app respectively.
  21. *
  22. * Some source files are shared for building native and WASM,
  23. * and this the mem allocator API for these files.
  24. *
  25. * Here we define it for the native world
  26. */
  27. #ifndef WA_MALLOC
  28. #define WA_MALLOC wasm_runtime_malloc
  29. #endif
  30. #ifndef WA_FREE
  31. #define WA_FREE wasm_runtime_free
  32. #endif
  33. /* The epsilon value is from https://www.cplusplus.com/reference/cfloat/ */
  34. #define WA_FLT_EPSILON 1e-5f
  35. #define WA_DBL_EPSILON 1e-9
  36. #endif /* #ifndef _BH_PLATFORM_H */