Fix compiler warning and test progs linker errors on Windows
authorBruce Cran <bruce.cran@gmail.com>
Thu, 7 May 2015 20:56:58 +0000 (14:56 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 7 May 2015 21:06:00 +0000 (15:06 -0600)
Add prototype for ctime_r to os-windows.h to avoid compiler warning.
Link in os/windows/posix.o and lib/hweight.o to allow test progs to
build on Windows.

Signed-off-by: Jens Axboe <axboe@fb.com>
Makefile
os/os-windows.h

index 1b312cbda08b2b6784a7b8a75f5978d74d996474..d9aedf52c5a1126b9e6b811e397b5c78b742fd9e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -218,6 +218,12 @@ T_OBJS += $(T_LFSR_TEST_OBJS)
 T_OBJS += $(T_BTRACE_FIO_OBJS)
 T_OBJS += $(T_DEDUPE_OBJS)
 
+ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
+    T_DEDUPE_OBJS += os/windows/posix.o lib/hweight.o
+    T_SMALLOC_OBJS += os/windows/posix.o lib/hweight.o
+    T_LFSR_TEST_OBJS += os/windows/posix.o lib/hweight.o
+endif
+
 T_TEST_PROGS = $(T_SMALLOC_PROGS)
 T_TEST_PROGS += $(T_IEEE_PROGS)
 T_PROGS += $(T_ZIPF_PROGS)
index 66036351e912c76979f06697c7e5d0dab43059d9..9e931c9c9e505d8438117cd89c72a5d2a3dae7ab 100644 (file)
@@ -105,6 +105,7 @@ int fcntl(int fildes, int cmd, ...);
 int fdatasync(int fildes);
 int lstat(const char * path, struct stat * buf);
 uid_t geteuid(void);
+char* ctime_r(const time_t *t, char *buf);
 int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
 ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);
 ssize_t pwrite(int fildes, const void *buf, size_t nbyte,