sta-core/include/sta/printf.hpp
2022-05-10 15:36:48 +02:00

43 lines
885 B
C++

/**
* @file
* @brief Compatibility layer for different printf implementations.
*/
#ifndef STA_PRINTF_HPP
#define STA_PRINTF_HPP
#ifdef DOXYGEN
/**
* @def STA_PRINTF_USE_STDLIB
* @brief Use printf implementation from STD library.
*
* @ingroup staCoreBuildConfig
*/
# define STA_PRINTF_USE_STDLIB
/**
* @def STA_PRINTF_USE_MPALAND
* @brief Use printf implementation from Marco Paland.
*
* @ingroup staCoreBuildConfig
*/
# define STA_PRINTF_USE_MPALAND
#endif // DOXYGEN
#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_PRINTF_HPP