Skip to content

Commit

Permalink
win32: compile fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ronnie Sahlberg <[email protected]>
  • Loading branch information
sahlberg committed Dec 13, 2024
1 parent d0e3565 commit 3b4fa16
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions include/win32/win32_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ THE SOFTWARE.
#include <time.h>
#include <stddef.h> // For size_t type

/* We always have multithreading for windows */
#ifndef HAVE_MULTITHREADING
#define HAVE_MULTITHREADING 1
#endif

typedef unsigned long fsblkcnt_t;
typedef unsigned long fsfilcnt_t;
typedef unsigned int uid_t;
Expand Down
4 changes: 4 additions & 0 deletions lib/libnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
#include <signal.h>
#endif

#ifdef WIN32
#include <win32/win32_compat.h>
#endif

#include <errno.h>
#include <stdarg.h>
#include <stdlib.h>
Expand Down
6 changes: 4 additions & 2 deletions lib/multithreading.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ int nfs_mt_sem_wait(libnfs_sem_t *sem)
}
#endif

#elif WIN32
#endif /* HAVE_PTHREAD */

#ifdef WIN32
nfs_tid_t nfs_mt_get_tid(void)
{
return GetCurrentThreadId();
Expand Down Expand Up @@ -340,7 +342,7 @@ int nfs_mt_sem_wait(libnfs_sem_t* sem)
return 0;
}

#endif
#endif /* WIN32 */


#endif /* HAVE_MULTITHREADING */
Expand Down

0 comments on commit 3b4fa16

Please sign in to comment.