Address more windows compile warnings

This commit is contained in:
Hamish Coleman
2023-06-29 06:00:56 +08:00
parent 5942726685
commit 041233dc8b
5 changed files with 23 additions and 7 deletions
+7
View File
@@ -50,8 +50,10 @@
// REVISIT: may become obsolete
#ifdef WIN32
#ifndef STDIN_FILENO
#define STDIN_FILENO _fileno(stdin)
#endif
#endif
typedef struct n2n_portfwd_conf {
@@ -197,6 +199,11 @@ int _kbhit () {
return FD_ISSET(STDIN_FILENO, &fds);
}
#else
// A dummy definition to avoid compile errors on windows
int _kbhit () {
return 0;
}
#endif
+7 -1
View File
@@ -75,8 +75,10 @@
// REVISIT: may become obsolete
#ifdef WIN32
#ifndef STDIN_FILENO
#define STDIN_FILENO _fileno(stdin)
#endif
#endif
typedef struct n2n_route {
@@ -496,7 +498,6 @@ void handle_route (n2n_route_t* in_route, int verb) {
#elif defined(WIN32)
// REVISIT: use 'CreateIpForwardEntry()' and 'DeleteIpForwardEntry()' [iphlpapi.h]
struct in_addr net_addr, gateway;
char c_net_addr[32];
char c_gateway[32];
char c_interface[32];
@@ -657,6 +658,11 @@ int _kbhit () {
return FD_ISSET(STDIN_FILENO, &fds);
}
#else
// A dummy definition to avoid compile errors on windows
int _kbhit () {
return 0;
}
#endif