aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conf_post.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/conf_post.h b/src/conf_post.h
index aaf4fb59ffb..e946f6fc90b 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -396,3 +396,41 @@ extern int emacs_setenv_TZ (char const *);
396 : S_ISCHR (mode) ? DT_CHR : S_ISFIFO (mode) ? DT_FIFO \ 396 : S_ISCHR (mode) ? DT_CHR : S_ISFIFO (mode) ? DT_FIFO \
397 : S_ISSOCK (mode) ? DT_SOCK : DT_UNKNOWN) 397 : S_ISSOCK (mode) ? DT_SOCK : DT_UNKNOWN)
398#endif /* MSDOS */ 398#endif /* MSDOS */
399
400#if defined WINDOWSNT
401# if !defined _UCRT
402# include <stdarg.h>
403# include <stdio.h>
404# include <stddef.h>
405
406/* Workarounds for MSVCRT bugs.
407
408 The functions below are in Gnulib, but their prototypes and
409 redirections must be here because the MS-Windows build omits the
410 Gnulib stdio-h module, which does the below in Gnulib's stdio.h
411 file, which is not used by the MS-Windows build. */
412
413extern size_t gl_consolesafe_fwrite (const void *ptr, size_t size,
414 size_t nmemb, FILE *fp)
415 ARG_NONNULL ((1, 4));
416extern int gl_consolesafe_fprintf (FILE *restrict fp,
417 const char *restrict format, ...)
418 ATTRIBUTE_FORMAT_PRINTF (2, 3)
419 ARG_NONNULL ((1, 2));
420extern int gl_consolesafe_printf (const char *restrict format, ...)
421 ATTRIBUTE_FORMAT_PRINTF (1, 2)
422 ARG_NONNULL ((1));
423extern int gl_consolesafe_vfprintf (FILE *restrict fp,
424 const char *restrict format, va_list args)
425 ATTRIBUTE_FORMAT_PRINTF (2, 0)
426 ARG_NONNULL ((1, 2));
427extern int gl_consolesafe_vprintf (const char *restrict format, va_list args)
428 ATTRIBUTE_FORMAT_PRINTF (1, 0)
429 ARG_NONNULL ((1));
430# define fwrite gl_consolesafe_fwrite
431# define fprintf gl_consolesafe_fprintf
432# define printf gl_consolesafe_printf
433# define vfprintf gl_consolesafe_vfprintf
434# define vprintf gl_consolesafe_vprintf
435# endif /* !_UCRT */
436#endif /* WINDOWSNT */