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