From a58b7ac6ce71819b712d0663f1d37bfb3cdd161c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Tue, 25 Aug 2020 03:37:41 +0200 Subject: fixup: Portable fileno() --- programs/util.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/programs/util.h b/programs/util.h index 6658bf9..2f3d0a8 100644 --- a/programs/util.h +++ b/programs/util.h @@ -143,6 +143,15 @@ extern "C" { #endif +/*-**************************************** +* fileno() function +******************************************/ +#if defined(_MSC_VER) +# define UTIL_fileno _fileno +#else +# define UTIL_fileno fileno +#endif + /* ************************************* * Constants ***************************************/ @@ -384,7 +393,7 @@ UTIL_STATIC U64 UTIL_getOpenFileSize(FILE* file) int fd; struct UTIL_TYPE_stat statbuf; - fd = fileno(file); + fd = UTIL_fileno(file); if (fd < 0) { perror("fileno"); exit(1); -- cgit v0.12