2018-02-04 17:11:56 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Oticon A/S
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#ifndef ZEPHYR_ARCH_POSIX_INCLUDE_POSIX_ARCH_INTERNAL_H_
|
|
|
|
#define ZEPHYR_ARCH_POSIX_INCLUDE_POSIX_ARCH_INTERNAL_H_
|
2018-02-04 17:11:56 +08:00
|
|
|
|
2018-02-11 23:30:49 +08:00
|
|
|
#include "toolchain.h"
|
|
|
|
|
2018-02-04 17:11:56 +08:00
|
|
|
#define _SAFE_CALL(a) _safe_call(a, #a)
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static inline void _safe_call(int test, const char *test_str)
|
|
|
|
{
|
|
|
|
/* LCOV_EXCL_START */ /* See Note1 */
|
2018-02-11 23:30:49 +08:00
|
|
|
if (unlikely(test)) {
|
2018-02-04 17:11:56 +08:00
|
|
|
posix_print_error_and_exit("POSIX arch: Error on: %s\n",
|
|
|
|
test_str);
|
|
|
|
}
|
|
|
|
/* LCOV_EXCL_STOP */
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#endif /* ZEPHYR_ARCH_POSIX_INCLUDE_POSIX_ARCH_INTERNAL_H_ */
|
2018-02-04 17:11:56 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Note 1:
|
|
|
|
*
|
|
|
|
* All checks for the host pthreads functions which are wrapped by _SAFE_CALL
|
|
|
|
* are meant to never fail, and therefore will not be covered.
|
|
|
|
*/
|