Monado OpenXR Runtime
euroc_driver.h
Go to the documentation of this file.
1// Copyright 2021, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Internal header for the euroc driver utilities.
6 * @author Mateo de Mayo <mateo.demayo@collabora.com>
7 * @ingroup drv_euroc
8 */
9#pragma once
10
11#include "util/u_logging.h"
12#include "euroc_interface.h"
13#include <assert.h>
14
15/*!
16 * @addtogroup drv_euroc
17 * @{
18 */
19
20#define EUROC_TRACE(e, ...) U_LOG_IFL_T(e->log_level, __VA_ARGS__)
21#define EUROC_DEBUG(e, ...) U_LOG_IFL_D(e->log_level, __VA_ARGS__)
22#define EUROC_INFO(e, ...) U_LOG_IFL_I(e->log_level, __VA_ARGS__)
23#define EUROC_WARN(e, ...) U_LOG_IFL_W(e->log_level, __VA_ARGS__)
24#define EUROC_ERROR(e, ...) U_LOG_IFL_E(e->log_level, __VA_ARGS__)
25#define EUROC_ASSERT(predicate, ...) \
26 do { \
27 bool p = predicate; \
28 if (!p) { \
29 U_LOG(U_LOGGING_ERROR, __VA_ARGS__); \
30 assert(false && "EUROC_ASSERT failed: " #predicate); \
31 exit(EXIT_FAILURE); \
32 } \
33 } while (false);
34#define EUROC_ASSERT_(predicate) EUROC_ASSERT(predicate, "Assertion failed " #predicate)
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/*!
41 * @}
42 */
43
44#ifdef __cplusplus
45}
46#endif
Interface for Euroc driver.
Basic logging functionality.