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 
24 #include_next "stdio.h"
25 
26 #ifdef MODULE_STDIO_NULL
27 
28 #include <stdarg.h>
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 static inline int printf_null(const char *__restrict__ format, ...)
36 {
37  (void)format;
38  return 0;
39 }
40 
41 static 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