Skip to main content

trace-c-api-inlines.h File

C header file with the empty inline stubs for the C trace API when tracing is disabled. More...

Description

C header file with the empty inline stubs for the C trace API when tracing is disabled.

Function declarations are located in trace-c-api.h. The stubs are separated into this file to improve project structure and maintainability.

File Listing

The file content with the documentation metadata removed is:

1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2015-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software
6 * for any purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can
9 * be obtained from https://opensource.org/licenses/mit.
10 */
11
12// ----------------------------------------------------------------------------
13
24
25// ----------------------------------------------------------------------------
26
27#if !defined(MICRO_OS_PLUS_DIAG_TRACE_H_)
28#error "Do not include this file directly; use <micro-os-plus/diag/trace.h>."
29#endif // MICRO_OS_PLUS_DIAG_TRACE_H_
30
31// ----------------------------------------------------------------------------
32
33#ifndef MICRO_OS_PLUS_DIAG_TRACE_C_API_INLINES_H_
34#define MICRO_OS_PLUS_DIAG_TRACE_C_API_INLINES_H_
35
36// ----------------------------------------------------------------------------
37
38// When TRACE is not enabled, define all as empty.
39#if !defined(MICRO_OS_PLUS_DIAG_TRACE_ENABLED)
40
41// ----------------------------------------------------------------------------
42
43#include <stdarg.h>
44#include <sys/types.h>
45
46// ----------------------------------------------------------------------------
47// Empty definitions.
48
49#pragma GCC diagnostic push
50#pragma GCC diagnostic ignored "-Wunused-parameter"
51
52static inline __attribute__ ((always_inline)) void
54{
55}
56
57#pragma GCC diagnostic push
58#if defined(__cplusplus)
59#pragma GCC diagnostic ignored "-Wold-style-cast"
60#endif // defined(__cplusplus)
61
62static inline __attribute__ ((always_inline)) ssize_t
63micro_os_plus_trace_write (const void* buf, size_t nbyte)
64{
65 return (ssize_t)(nbyte);
66}
67
68static inline __attribute__ ((always_inline)) void
70{
71}
72
73#pragma GCC diagnostic pop
74
75// ----------------------------------------------------------------------------
76
77static inline __attribute__ ((always_inline)) int
78micro_os_plus_trace_printf (const char* format, ...)
79{
80 return 0;
81}
82
83static inline __attribute__ ((always_inline)) int
84micro_os_plus_trace_vprintf (const char* format, va_list arguments)
85{
86 return 0;
87}
88
89static inline __attribute__ ((always_inline)) int
90micro_os_plus_trace_puts (const char* s)
91{
92 return 0;
93}
94
95static inline __attribute__ ((always_inline)) int
97{
98 return c;
99}
100
101static inline __attribute__ ((always_inline)) void
102micro_os_plus_trace_dump_args (int argc, char* argv[])
103{
104}
105
106#pragma GCC diagnostic pop
107
108// ----------------------------------------------------------------------------
109
110#endif // !defined(MICRO_OS_PLUS_DIAG_TRACE_ENABLED)
111
112// ----------------------------------------------------------------------------
113
114#endif // MICRO_OS_PLUS_DIAG_TRACE_C_API_INLINES_H_
115
116// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.1 by Doxygen 1.17.0.