Skip to content

Commit

Permalink
Fix io includes (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
eisenhauer authored Aug 4, 2024
1 parent ca70df0 commit cf5044b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ CHECK_INCLUDE_FILE(sys/un.h HAVE_SYS_UN_H)
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H)
CHECK_INCLUDE_FILE(winsock.h HAVE_WINSOCK_H)
CHECK_INCLUDE_FILE(winsock2.h HAVE_WINSOCK2_H)

if(SIZEOF_SIZE_T EQUAL SIZEOF_INT)
set(UIO_SIZE_T_TYPE "unsigned int")
Expand Down
3 changes: 3 additions & 0 deletions config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
/* Define to 1 if you have the <winsock.h> header file. */
#cmakedefine HAVE_WINSOCK_H

/* Define to 1 if you have the <winsock2.h> header file. */
#cmakedefine HAVE_WINSOCK2_H

/* Define if you need struct iovec to be defined */
#cmakedefine NEED_IOVEC_DEFINE

Expand Down
8 changes: 5 additions & 3 deletions fm/nt_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
#define HAVE_IOVEC_DEFINE
#endif
#define FD_SETSIZE 1024
#ifdef HAVE_WINSOCK2_H
#include "winsock2.h"
#endif
#include <windows.h>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include "ffs.h"
#include "io_interface.h"
#include "ffs_internal.h"
#include "fm.h"
#include "fm_internal.h"

static int
nt_file_read_func(conn, buffer, length, errno_p, result_p)
Expand Down
3 changes: 3 additions & 0 deletions fm/unix_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <sys/uio.h>
#define HAVE_IOVEC_DEFINE
#endif
#ifdef HAVE_WINSOCK2_H
#include "winsock2.h"
#endif
#include <stdio.h>
#include "fm.h"
#include "fm_internal.h"
Expand Down

0 comments on commit cf5044b

Please sign in to comment.