Skip to content

Commit

Permalink
Ignore pragma comment if not MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
matricali committed Jul 25, 2024
1 parent 1125313 commit 460988c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/detection.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ SOFTWARE.
#include <winsock2.h>
#include <windows.h>
#include <ws2tcpip.h>
#ifdef _MSC_VER
#pragma comment(lib, "ws2_32.lib")
#endif // _MSC_VER
typedef int socklen_t;
#else
#include <arpa/inet.h>
Expand Down
2 changes: 2 additions & 0 deletions src/iprange.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#ifdef _MSC_VER
#pragma comment(lib, "ws2_32.lib")
#endif // _MSC_VER
#else
#include <arpa/inet.h> /* ntohl */
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/iprange.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include <winsock2.h>
#include <ws2tcpip.h>
typedef int in_addr_t;
#ifdef _MSC_VER
#pragma comment(lib, "ws2_32.lib")
#endif // _MSC_VER
#else
#include <arpa/inet.h> /* in_addr_t */
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ SOFTWARE.
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#ifdef _MSC_VER
#pragma comment(lib, "ws2_32.lib")
#endif // _MSC_VER
#else
#include <arpa/inet.h>
#include <netdb.h>
Expand Down

0 comments on commit 460988c

Please sign in to comment.