Skip to content

Commit f8ed5a9

Browse files
committed
Fixes #144, fixes #145: Rearranged system header inclusion in printf.c and removes its excessive use of extern "C".
1 parent 00b8319 commit f8ed5a9

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/printf/printf.c

+9-17
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,23 @@
3737
* THE SOFTWARE.
3838
*/
3939

40-
#ifdef __cplusplus
41-
#include <cstdint>
42-
#include <climits>
43-
extern "C" {
44-
#else
45-
#include <stdbool.h>
46-
#include <stdint.h>
47-
#include <limits.h>
48-
#endif // __cplusplus
49-
5040
// Define this globally (e.g. gcc -DPRINTF_INCLUDE_CONFIG_H=1 ...) to include the
5141
// printf_config.h header file
5242
#if PRINTF_INCLUDE_CONFIG_H
5343
#include "printf_config.h"
5444
#endif
5545

56-
#include <stdbool.h>
57-
#include <stdint.h>
58-
5946
#include <printf/printf.h>
6047

48+
#ifdef __cplusplus
49+
#include <cstdint>
50+
#include <climits>
51+
#else
52+
#include <stdint.h>
53+
#include <limits.h>
54+
#include <stdbool.h>
55+
#endif // __cplusplus
56+
6157
#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
6258
# define printf_ printf
6359
# define sprintf_ sprintf
@@ -1427,7 +1423,3 @@ int fctprintf(void (*out)(char c, void* extra_arg), void* extra_arg, const char*
14271423
return ret;
14281424
}
14291425

1430-
1431-
#ifdef __cplusplus
1432-
} // extern "C"
1433-
#endif

0 commit comments

Comments
 (0)