gulaftab / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Mainline doesn't compile on Cygwin #518

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of Redis you are using, in what kind of Operating System?
  trunk from github on Cygwin Windows XP

What is the problem you are experiencing?
  compile error:

redis.c: In function `dictSdsKeyCaseCompare':
redis.c:292: warning: implicit declaration of function `strcasecmp'
redis.c: In function `setupSignalHandlers':
redis.c:1791: error: `SA_ONSTACK' undeclared (first use in this function)
redis.c:1791: error: (Each undeclared identifier is reported only once
redis.c:1791: error: for each function it appears in.)
make[1]: *** [redis.o] Error 1

What steps will reproduce the problem?
  build on cygwin

Please provide any additional information below.

SA_ONSTACK is not defined for Cygwin. Defining it as 0 fixes the compiler error 
and the resulting executable seems to work, at least for basic testing. Here is 
the patch:

diff --git a/src/redis.c b/src/redis.c
index 866ac36..1fc97af 100644
--- a/src/redis.c
+++ b/src/redis.c
@@ -53,6 +53,10 @@
 #include <pthread.h>
 #include <sys/resource.h>

+#ifndef SA_ONSTACK
+#define SA_ONSTACK 0
+#endif
+
 /* Our shared "common" objects */

 struct sharedObjectsStruct shared;

Original issue reported on code.google.com by raff...@gmail.com on 13 Apr 2011 at 3:29

GoogleCodeExporter commented 9 years ago
Having the same issue on Win7/Cygwin

Original comment by dtmu...@gmail.com on 26 Jul 2011 at 2:29

GoogleCodeExporter commented 9 years ago
This might work for testing, but Cygwin is not supported and we don't know what 
the effects of this patch are. We don't want to give people the impression that 
Cygwin is or will be supported, so this patch won't be applied. People that 
want to compile Redis on Cygwin can always apply this patch and see how it 
works out for them.

Original comment by pcnoordh...@gmail.com on 27 Jul 2011 at 9:37

GoogleCodeExporter commented 9 years ago
This does not resolve all problems for 2.4.4:

debug.o: In function `_redisAssert':
/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/src/debug.c:340: 
undefined reference to `_bugReportStart'
debug.o: In function `_redisPanic':
/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/src/debug.c:353: 
undefined reference to `_bugReportStart'
collect2: ld returned 1 exit status
Makefile:188: recipe for target `redis-server' failed
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory 
`/cygdrive/c/Users/Marcin/Documents/oneclickcos/redis-2.4.4/src'
Makefile:6: recipe for target `all' failed
make: *** [all] Error 2

Original comment by marcin.t...@gmail.com on 4 Dec 2011 at 12:21