assert.h 666 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2016 Intel Corporation
  3. * Copyright (c) 2016, Freescale Semiconductor, Inc.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. */
  7. #ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ASSERT_H_
  8. #define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ASSERT_H_
  9. #include <sys/__assert.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #else
  13. #if __STDC_VERSION__ >= 201112L
  14. #define static_assert _Static_assert
  15. #endif /* __STDC_VERSION__ */
  16. #endif /* __cplusplus */
  17. #ifndef NDEBUG
  18. #ifndef assert
  19. #define assert(test) __ASSERT_NO_MSG(test)
  20. #endif
  21. #else
  22. #ifndef assert
  23. #define assert(test) ((void)0)
  24. #endif
  25. #endif
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ASSERT_H_ */