mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 10:03:50 +01:00
core/lib/include/ringbuffer.h: removed trailing newline core/lib/include/irq.h: restored header guard for irq.h to resolve build errors core/lib/include/irq.h: added trailing newline to irq.h
70 lines
1.2 KiB
C
70 lines
1.2 KiB
C
/*
|
|
* Copyright (C) 2024 ML!PA Consulting GmbH
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
|
* Public License v2.1. See the file LICENSE in the top level directory for more
|
|
* details.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
/**
|
|
* @ingroup sys_stdio_null
|
|
*
|
|
* This module a wrapper for the stdio.h header intended to remove all calls
|
|
* to stdout when stdio_null is used.
|
|
*
|
|
* This needs to reside in `core/` so it gets included early.
|
|
*
|
|
* @{
|
|
*
|
|
* @file
|
|
* @brief stdio wrapper to replace the C libs stdio
|
|
*
|
|
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
|
|
*/
|
|
|
|
#include_next "stdio.h"
|
|
|
|
#ifdef MODULE_STDIO_NULL
|
|
|
|
#include <stdarg.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
static inline int printf_null(const char *__restrict__ format, ...)
|
|
{
|
|
(void)format;
|
|
return 0;
|
|
}
|
|
|
|
static inline int vprintf_null(const char *__restrict__ format, va_list ap)
|
|
{
|
|
(void)format;
|
|
(void)ap;
|
|
return 0;
|
|
}
|
|
|
|
#undef perror
|
|
#undef putchar
|
|
#undef puts
|
|
#undef printf
|
|
#undef vprintf
|
|
|
|
#define perror(s) (void)s
|
|
#define puts(s) (void)s
|
|
#define putchar(c) (void)c
|
|
#define printf(...) printf_null(__VA_ARGS__)
|
|
#define vprintf(format, ap) vprintf_null(format, ap)
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* MODULE_STDIO_NULL */
|
|
|
|
/** @} */
|