Skip to content

Commit

Permalink
Fix microsoft build
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf3s committed Nov 20, 2023
1 parent 3caf603 commit c01f319
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
4 changes: 4 additions & 0 deletions lib/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#define _GNU_SOURCE
#endif

#ifdef _WINDOWS
#define HAVE_SYS_SOCKET_H 1
#endif

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions lib/libsmb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#define _GNU_SOURCE
#endif

#ifdef _WINDOWS
#define HAVE_SYS_SOCKET_H 1
#endif

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
Expand Down
15 changes: 11 additions & 4 deletions lib/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
#define _GNU_SOURCE
#endif

#ifdef _WINDOWS
#define HAVE_POLL_H 1
#define HAVE_SYS_SOCKET_H 11
#endif

#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
Expand All @@ -35,9 +40,11 @@
#include <netinet/in.h>
#endif

#if defined(HAVE_SYS_POLL_H)
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#elif defined(HAVE_POLL_H) || defined(_WINDOWS)
#endif

#ifdef HAVE_POLL_H
#include <poll.h>
#endif

Expand Down Expand Up @@ -72,11 +79,11 @@
#include "portable-endian.h"
#include <errno.h>

#if defined(HAVE_FCNTL_H)
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

#if defined(HAVE_SYS_SOCKET_H) || defined(_WINDOWS)
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif

Expand Down
8 changes: 7 additions & 1 deletion lib/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#define _GNU_SOURCE
#endif

#ifdef _WINDOWS
#define HAVE_POLL_H 1
#endif

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
Expand All @@ -35,7 +39,9 @@

#if defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
#elif defined(HAVE_POLL_H) || defined(_WINDOWS)
#endif

#ifdef HAVE_POLL_H
#include <poll.h>
#endif

Expand Down

0 comments on commit c01f319

Please sign in to comment.