diff --git a/src/lib/commands/rea.c b/src/lib/commands/rea.c index def7a104..89ca17b4 100644 --- a/src/lib/commands/rea.c +++ b/src/lib/commands/rea.c @@ -36,8 +36,10 @@ #include #include +#include #include "commands.h" #include "match.h" +#include "misc.h" #include "optlist.h" #include "tel.h" diff --git a/src/lib/w32/posixio.c b/src/lib/w32/posixio.c index 6c0e8394..6af4b9b7 100644 --- a/src/lib/w32/posixio.c +++ b/src/lib/w32/posixio.c @@ -129,7 +129,7 @@ set_fd(int fd, enum fdmap_io_type type, int handle) fdmap[fd].type = type; /* - * Garbage collection for posix_fileno(), currently not + * Garbage collection for fileno(), currently not * replacing fclose() and fcloseall() so do not know when * a stream is closed. */ @@ -586,7 +586,7 @@ writev(int fd, const struct iovec *iov, int iovcnt) * handle is reused. */ int -posix_fileno(FILE *stream) +fileno(FILE *stream) { int fd; int handle; diff --git a/src/lib/w32/unistd.h b/src/lib/w32/unistd.h index 2a407c9a..32aeeb6c 100644 --- a/src/lib/w32/unistd.h +++ b/src/lib/w32/unistd.h @@ -36,7 +36,6 @@ #include #include -#undef fileno #include #include "sys/socket.h" #include @@ -108,8 +107,6 @@ typedef int socklen_t; #define read posix_read #define write(fd, buffer, count) \ posix_write((fd), (buffer), (count)) -#define fileno(stream) \ - posix_fileno((stream)) #define fsync(fd) \ posix_fsync((fd)) diff --git a/src/lib/w32/w32misc.h b/src/lib/w32/w32misc.h index a3bd3c0e..cc2a545c 100644 --- a/src/lib/w32/w32misc.h +++ b/src/lib/w32/w32misc.h @@ -46,6 +46,7 @@ /* stdio.h */ #define vsnprintf _vsnprintf #define snprintf _snprintf +#undef fileno /* stdlib.h */ #define random rand