xref: /netbsd-src/external/bsd/ntp/dist/include/c99_snprintf.h (revision eabc0478de71e4e011a5b4e0392741e01d491794)
1*eabc0478Schristos /*	$NetBSD: c99_snprintf.h,v 1.2 2024/08/18 20:46:50 christos Exp $	*/
2897be3a4Schristos 
3897be3a4Schristos /*
4897be3a4Schristos  * ntp_c99_snprintf.h
5897be3a4Schristos  *
6897be3a4Schristos  * Included from config.h to deal with replacing [v]snprintf() on older
7897be3a4Schristos  * systems.  The #undef lines below cannot be directly in config.h as
8897be3a4Schristos  * config.status modifies each #undef in config.h.in to either be a
9897be3a4Schristos  * commented-out #undef or a functional #define.  Here they are used
10897be3a4Schristos  * to avoid redefinition warnings on systems such as macos ca. 2024
11897be3a4Schristos  * where system headers define [v]snprintf as preprocessor macros.
12897be3a4Schristos  *
13897be3a4Schristos  * Do not include this file directly, leave it to config.h.
14897be3a4Schristos  */
15897be3a4Schristos 
16897be3a4Schristos #if !defined(_KERNEL) && !defined(PARSESTREAM)
17897be3a4Schristos /*
18897be3a4Schristos  * stdio.h must be included in config.h after _GNU_SOURCE is defined
19897be3a4Schristos  * but before #define snprintf rpl_snprintf
20897be3a4Schristos  */
21897be3a4Schristos # include <stdio.h>
22897be3a4Schristos #endif
23897be3a4Schristos 
24897be3a4Schristos #ifdef HW_WANT_RPL_SNPRINTF
25897be3a4Schristos # undef snprintf
26897be3a4Schristos #endif
27897be3a4Schristos #ifdef HW_WANT_RPL_VSNPRINTF
28897be3a4Schristos # undef vsnprintf
29897be3a4Schristos #endif
30897be3a4Schristos 
31