From f8ed5a9bd9fa8384430973465e94aa14c925872d Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Fri, 14 Oct 2022 16:09:08 +0300 Subject: [PATCH] Fixes #144, fixes #145: Rearranged system header inclusion in `printf.c` and removes its excessive use of extern "C". --- src/printf/printf.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/printf/printf.c b/src/printf/printf.c index 0f2592f..8d65787 100644 --- a/src/printf/printf.c +++ b/src/printf/printf.c @@ -37,27 +37,23 @@ * THE SOFTWARE. */ -#ifdef __cplusplus -#include -#include -extern "C" { -#else -#include -#include -#include -#endif // __cplusplus - // Define this globally (e.g. gcc -DPRINTF_INCLUDE_CONFIG_H=1 ...) to include the // printf_config.h header file #if PRINTF_INCLUDE_CONFIG_H #include "printf_config.h" #endif -#include -#include - #include +#ifdef __cplusplus +#include +#include +#else +#include +#include +#include +#endif // __cplusplus + #if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES # define printf_ printf # define sprintf_ sprintf @@ -1427,7 +1423,3 @@ int fctprintf(void (*out)(char c, void* extra_arg), void* extra_arg, const char* return ret; } - -#ifdef __cplusplus -} // extern "C" -#endif