Remove the extern posix_fileno().
(fileno) [_WIN32]: Replace system fileno() with a function that supports posix
file descriptors. Move #undef fileno to w32misc.h as the system define
is in stdio.h.
(rea) [_WIN32]: Add stdio.h for fileno() extern declaration and add misc.h
to ensure the WIN32 fixes to stdio.h are included.
#include <config.h>
#include <ctype.h>
+#include <stdio.h>
#include "commands.h"
#include "match.h"
+#include "misc.h"
#include "optlist.h"
#include "tel.h"
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.
*/
* handle is reused.
*/
int
-posix_fileno(FILE *stream)
+fileno(FILE *stream)
{
int fd;
int handle;
#include <io.h>
#include <stdio.h>
-#undef fileno
#include <direct.h>
#include "sys/socket.h"
#include <sys/stat.h>
#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))
/* stdio.h */
#define vsnprintf _vsnprintf
#define snprintf _snprintf
+#undef fileno
/* stdlib.h */
#define random rand