sta-core/include/sta/printf.hpp
2023-01-31 21:14:02 +01:00

28 lines
722 B
C++

/**
* @file
* @brief Compatibility layer for different printf implementations.
*
* Configuration:
* * STA_PRINTF_USE_STDLIB: Use printf implementation from standard library
* * STA_PRINTF_USE_MPALAND: Use printf implementation from Marco Paland
*/
#ifndef STA_CORE_PRINTF_HPP
#define STA_CORE_PRINTF_HPP
#include <sta/config.hpp>
#if !defined(STA_PRINTF_USE_STDLIB) && !defined(STA_PRINTF_USE_MPALAND)
# error "No printf implementation chosen!"
#endif // !STA_PRINTF_USE_STDLIB && !STA_PRINTF_USE_MPALAND
#ifdef STA_PRINTF_USE_STDLIB
# include <cstdio>
#endif // STA_PRINTF_USE_STDLIB
#ifdef STA_PRINTF_USE_MPALAND
# include <printf.h>
#endif // STA_PRINTF_USE_MPALAND
#endif // STA_CORE_PRINTF_HPP