xref: /freebsd/contrib/ntp/include/c99_snprintf.h (revision db33c6f3ae9d1231087710068ee4ea5398aacca7)
1 /*
2  * ntp_c99_snprintf.h
3  *
4  * Included from config.h to deal with replacing [v]snprintf() on older
5  * systems.  The #undef lines below cannot be directly in config.h as
6  * config.status modifies each #undef in config.h.in to either be a
7  * commented-out #undef or a functional #define.  Here they are used
8  * to avoid redefinition warnings on systems such as macos ca. 2024
9  * where system headers define [v]snprintf as preprocessor macros.
10  *
11  * Do not include this file directly, leave it to config.h.
12  */
13 
14 #if !defined(_KERNEL) && !defined(PARSESTREAM)
15 /*
16  * stdio.h must be included in config.h after _GNU_SOURCE is defined
17  * but before #define snprintf rpl_snprintf
18  */
19 # include <stdio.h>
20 #endif
21 
22 #ifdef HW_WANT_RPL_SNPRINTF
23 # undef snprintf
24 #endif
25 #ifdef HW_WANT_RPL_VSNPRINTF
26 # undef vsnprintf
27 #endif
28 
29