Loading...
Searching...
No Matches
stdio.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 ML!PA Consulting GmbH
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
23
24#include_next "stdio.h"
25
26#ifdef MODULE_STDIO_NULL
27
28#include <stdarg.h>
29
30#ifdef __cplusplus
31extern "C"
32{
33#endif
34
35static inline int printf_null(const char *__restrict__ format, ...)
36{
37 (void)format;
38 return 0;
39}
40
41static inline int vprintf_null(const char *__restrict__ format, va_list ap)
42{
43 (void)format;
44 (void)ap;
45 return 0;
46}
47
48#undef perror
49#undef putchar
50#undef puts
51#undef printf
52#undef vprintf
53
54#define perror(s) (void)s
55#define puts(s) (void)s
56#define putchar(c) (void)c
57#define printf(...) printf_null(__VA_ARGS__)
58#define vprintf(format, ap) vprintf_null(format, ap)
59
60#ifdef __cplusplus
61}
62#endif
63
64#endif /* MODULE_STDIO_NULL */
65