Skip to content

Commit

Permalink
Fixes #144, fixes #145: Rearranged system header inclusion in `printf…
Browse files Browse the repository at this point in the history
….c` and removes its excessive use of extern "C".
  • Loading branch information
eyalroz committed Oct 17, 2022
1 parent 00b8319 commit f8ed5a9
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions src/printf/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,23 @@
* THE SOFTWARE.
*/

#ifdef __cplusplus
#include <cstdint>
#include <climits>
extern "C" {
#else
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#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 <stdbool.h>
#include <stdint.h>

#include <printf/printf.h>

#ifdef __cplusplus
#include <cstdint>
#include <climits>
#else
#include <stdint.h>
#include <limits.h>
#include <stdbool.h>
#endif // __cplusplus

#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
# define printf_ printf
# define sprintf_ sprintf
Expand Down Expand Up @@ -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

0 comments on commit f8ed5a9

Please sign in to comment.