bh_common.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef _BH_COMMON_H
  17. #define _BH_COMMON_H
  18. #include "bh_assert.h"
  19. #include "bh_definition.h"
  20. #include "bh_platform.h"
  21. #include "bh_log.h"
  22. #include "bh_list.h"
  23. #define bh_memcpy_s(dest, dlen, src, slen) do { \
  24. int _ret = slen == 0 ? 0 : b_memcpy_s (dest, dlen, src, slen); \
  25. (void)_ret; \
  26. bh_assert (_ret == 0); \
  27. } while (0)
  28. #define bh_strcat_s(dest, dlen, src) do { \
  29. int _ret = b_strcat_s (dest, dlen, src); \
  30. (void)_ret; \
  31. bh_assert (_ret == 0); \
  32. } while (0)
  33. #define bh_strcpy_s(dest, dlen, src) do { \
  34. int _ret = b_strcpy_s (dest, dlen, src); \
  35. (void)_ret; \
  36. bh_assert (_ret == 0); \
  37. } while (0)
  38. #endif