summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Grunder <michael.grunder@gmail.com>2020-07-10 12:53:52 -0700
committerGitHub <noreply@github.com>2020-07-10 12:53:52 -0700
commit1864e76ea7323fd8789d9c8b5b3c8ca27d4840a6 (patch)
tree42688dce1a829420001322fb7af30248ff6251e5
parentada366527943b53d749963797080966f99e837f4 (diff)
Some Windows quality of life improvments. (#846)
* Don't try to ignore SIGPIPE in Windows (it doesn't exist). * Add an include to our win32.h compatibility header. * Enable building examples on Travis in Windows. See #831
-rw-r--r--.travis.yml2
-rw-r--r--examples/example-ivykis.c2
-rw-r--r--examples/example-libev.c2
-rw-r--r--examples/example-libevent-ssl.c3
-rw-r--r--examples/example-libevent.c3
-rw-r--r--examples/example-libuv.c3
-rw-r--r--examples/example-ssl.c1
-rw-r--r--examples/example.c2
8 files changed, 16 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 8344c4d..792d175 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -108,5 +108,5 @@ jobs:
script:
- mkdir build && cd build
- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64 '&&'
- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release '&&' ninja -v
+ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_EXAMPLES=ON '&&' ninja -v
- ./hiredis-test.exe
diff --git a/examples/example-ivykis.c b/examples/example-ivykis.c
index 67affce..f57dc38 100644
--- a/examples/example-ivykis.c
+++ b/examples/example-ivykis.c
@@ -33,7 +33,9 @@ void disconnectCallback(const redisAsyncContext *c, int status) {
}
int main (int argc, char **argv) {
+#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
+#endif
iv_init();
diff --git a/examples/example-libev.c b/examples/example-libev.c
index cc8b166..ec47430 100644
--- a/examples/example-libev.c
+++ b/examples/example-libev.c
@@ -33,7 +33,9 @@ void disconnectCallback(const redisAsyncContext *c, int status) {
}
int main (int argc, char **argv) {
+#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
+#endif
redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379);
if (c->err) {
diff --git a/examples/example-libevent-ssl.c b/examples/example-libevent-ssl.c
index aac5770..7d99af1 100644
--- a/examples/example-libevent-ssl.c
+++ b/examples/example-libevent-ssl.c
@@ -34,7 +34,10 @@ void disconnectCallback(const redisAsyncContext *c, int status) {
}
int main (int argc, char **argv) {
+#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
+#endif
+
struct event_base *base = event_base_new();
if (argc < 5) {
fprintf(stderr,
diff --git a/examples/example-libevent.c b/examples/example-libevent.c
index 1fe71ae..f3fa2a6 100644
--- a/examples/example-libevent.c
+++ b/examples/example-libevent.c
@@ -38,7 +38,10 @@ void disconnectCallback(const redisAsyncContext *c, int status) {
}
int main (int argc, char **argv) {
+#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
+#endif
+
struct event_base *base = event_base_new();
redisOptions options = {0};
REDIS_OPTIONS_SET_TCP(&options, "127.0.0.1", 6379);
diff --git a/examples/example-libuv.c b/examples/example-libuv.c
index a5462d4..cbde452 100644
--- a/examples/example-libuv.c
+++ b/examples/example-libuv.c
@@ -33,7 +33,10 @@ void disconnectCallback(const redisAsyncContext *c, int status) {
}
int main (int argc, char **argv) {
+#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
+#endif
+
uv_loop_t* loop = uv_default_loop();
redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379);
diff --git a/examples/example-ssl.c b/examples/example-ssl.c
index c676ed8..5eb2bbb 100644
--- a/examples/example-ssl.c
+++ b/examples/example-ssl.c
@@ -4,6 +4,7 @@
#include <hiredis.h>
#include <hiredis_ssl.h>
+#include <win32.h>
int main(int argc, char **argv) {
unsigned int j;
diff --git a/examples/example.c b/examples/example.c
index 0e93fc8..15dacbd 100644
--- a/examples/example.c
+++ b/examples/example.c
@@ -1,8 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
#include <hiredis.h>
+#include <win32.h>
int main(int argc, char **argv) {
unsigned int j, isunix = 0;