Re: Windows Make Broken

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/21/16 9:18 PM, Jens Axboe wrote:
On 01/21/2016 02:53 PM, Bruce Cran wrote:
Yeah, there's also a problem with strcasestr.c. I'm working on fixing
both problems just now.

We'll just spin a 2.6 once that's fixed.

I've attached a patch that should fix it. The removal of strcasestr.o is because I was getting a error saying strcasestr had already been defined.

--
Bruce
>From 6ab23ee572ee4ad9562318d9168293df177a5c59 Mon Sep 17 00:00:00 2001
From: Bruce Cran <bruce.cran@xxxxxxxxx>
Date: Fri, 22 Jan 2016 10:54:47 -0700
Subject: [PATCH] Fix Windows build: define MSG_DONTWAIT and avoid duplicate
 strcasestr definition

---
 Makefile        | 2 +-
 os/os-windows.h | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index b6ebf2f..febc8f8 100644
--- a/Makefile
+++ b/Makefile
@@ -200,7 +200,7 @@ T_IEEE_PROGS = t/ieee754
 
 T_ZIPF_OBS = t/genzipf.o
 T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/pattern.o lib/zipf.o \
-		lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o
+		lib/strntol.o lib/gauss.o t/genzipf.o
 T_ZIPF_PROGS = t/fio-genzipf
 
 T_AXMAP_OBJS = t/axmap.o
diff --git a/os/os-windows.h b/os/os-windows.h
index 159c086..7305dd0 100644
--- a/os/os-windows.h
+++ b/os/os-windows.h
@@ -20,6 +20,11 @@
 
 #include "windows/posix.h"
 
+/* Cygwin doesn't define rand_r if C99 or newer is being used */
+#if defined(WIN32) && !defined(rand_r)
+int rand_r(unsigned *);
+#endif
+
 #ifndef PTHREAD_STACK_MIN
 #define PTHREAD_STACK_MIN 65535
 #endif
@@ -69,7 +74,7 @@ typedef DWORD_PTR os_cpu_mask_t;
 #define O_NONBLOCK		FIONBIO
 
 /* Winsock doesn't support MSG_WAIT */
-#define OS_MSG_DONTWAIT	0
+#define MSG_DONTWAIT 0
 
 #define POLLOUT	1
 #define POLLIN	2
-- 
2.5.2.windows.2


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux