-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_printf.h
More file actions
25 lines (17 loc) · 711 Bytes
/
_printf.h
File metadata and controls
25 lines (17 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef PRINTF_MAIN_H
#define PRINTF_MAIN_H
#define ATTR_FORMAT_FUNCTION(archetype, str_position, first_to_check)
/* https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html */
#if defined __has_attribute
/**
* https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
* #index-format-function-attribute
*/
#if __has_attribute(format)
#undef ATTR_FORMAT_FUNCTION
#define ATTR_FORMAT_FUNCTION(archetype, str_position, first_to_check) \
__attribute__((format(archetype, str_position, first_to_check)))
#endif /* __has_attribute(format) */
#endif /* __has_attribute */
ATTR_FORMAT_FUNCTION(printf, 1, 2) int _printf(const char *format, ...);
#endif /* PRINTF_MAIN_H */