Skip to content

Commit

Permalink
Address issues compiling on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishcoleman committed Oct 26, 2024
1 parent 0527053 commit da33cab
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/mainloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
#include <n2n_typedefs.h> // for n3n_runtime_data
#include <stddef.h>
#include <stdint.h>

#ifndef _WIN32
#include <sys/select.h> // for select, FD_ZERO,
#endif

#include "n2n_define.h"

Expand Down
2 changes: 1 addition & 1 deletion src/management.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <n3n/metrics.h> // for n3n_metrics_render
#include <n3n/strings.h> // for ip_subnet_to_str, sock_to_cstr
#include <n3n/supernode.h> // for load_allowed_sn_community
#include <netinet/in.h>
#include <sn_selection.h> // for sn_selection_criterion_str
#include <stdbool.h>
#include <stddef.h>
Expand All @@ -36,6 +35,7 @@
#include "win32/defs.h"
#else
#include <netdb.h> // for getnameinfo, NI_NUMERICHOST, NI_NUMERICSERV
#include <netinet/in.h>
#include <sys/socket.h> // for sendto, sockaddr
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/n2n.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <n3n/logging.h> // for traceEvent
#include <n3n/random.h> // for n3n_rand
#include <n3n/strings.h> // for ip_subnet_to_str, sock_to_cstr
#include <netinet/in.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h> // for free, atoi, calloc, strtol
Expand All @@ -41,6 +40,7 @@
#include <ws2def.h>
#else
#include <arpa/inet.h> // for inet_ntop
#include <netinet/in.h>
#include <sys/socket.h> // for AF_INET, PF_INET, bind, setsockopt, shut...
#endif

Expand Down
3 changes: 3 additions & 0 deletions src/peer_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

#ifndef _WIN32
#include <sys/socket.h>
#endif

#include "management.h" // for mgmt_event_post
#include "peer_info.h"
Expand Down
2 changes: 1 addition & 1 deletion src/resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <n3n/logging.h>
#include <n3n/metrics.h>
#include <n3n/resolve.h> // for n3n_resolve_parameter_t
#include <netinet/in.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
Expand All @@ -31,6 +30,7 @@ struct peer_info;
#include <ws2def.h>
#else
#include <netdb.h> // for addrinfo, freeaddrinfo, gai_strerror
#include <netinet/in.h>
#include <sys/socket.h> // for AF_INET, PF_INET
#include <sys/time.h> // for gettimeofday, timersub
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/sn_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <n3n/random.h> // for n3n_rand, n3n_rand_sqr
#include <n3n/strings.h> // for ip_subnet_to_str, sock_to_cstr
#include <n3n/supernode.h> // for load_allowed_sn_community, calculate_...
#include <pwd.h>
#include <stdbool.h>
#include <stdint.h> // for uint8_t, uint32_t, uint16_t, uint64_t
#include <stdio.h> // for sscanf, snprintf, fclose, fgets, fopen
Expand Down Expand Up @@ -60,6 +59,7 @@
#include <arpa/inet.h> // for inet_addr, inet_ntoa
#include <netinet/in.h> // for ntohl, in_addr_t, sockaddr_in, INADDR...
#include <netinet/tcp.h> // for TCP_NODELAY
#include <pwd.h>
#include <sys/select.h> // for FD_ISSET, FD_SET, select, FD_SETSIZE
#include <sys/socket.h> // for recvfrom, shutdown, sockaddr_storage
#endif
Expand Down

0 comments on commit da33cab

Please sign in to comment.