From 314c04840b5d576e7178f13e75a21b87e8bf01de Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 2 Nov 2010 17:37:22 +0100 Subject: [PATCH] Update examples --- Makefile | 4 ++-- example-libev.c | 6 +++--- example-libevent.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index cb1fe22..2ae73d4 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,9 @@ ifeq ($(uname_S),SunOS) STLIBNAME?=libhiredis.a STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ} else ifeq ($(uname_S),Darwin) - ARCH?= -arch i386 -arch x86_64 CFLAGS?= -std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wwrite-strings $(ARCH) $(PROF) CCLINK?= -lm -pthread + OBJARCH?= -arch i386 -arch x86_64 DYLIBNAME?=libhiredis.dylib DYLIB_MAKE_CMD?=libtool -dynamic -o ${DYLIBNAME} -lm ${DEBUG} - ${OBJ} STLIBNAME?=libhiredis.a @@ -73,7 +73,7 @@ test: hiredis-test ./hiredis-test .c.o: - $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $< + $(CC) -c $(CFLAGS) $(OBJARCH) $(DEBUG) $(COMPILE_TIME) $< clean: rm -rf ${DYLIBNAME} ${STLIBNAME} $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov diff --git a/example-libev.c b/example-libev.c index f17fe4e..199d706 100644 --- a/example-libev.c +++ b/example-libev.c @@ -17,7 +17,7 @@ void getCallback(redisAsyncContext *c, void *r, void *privdata) { void disconnectCallback(const redisAsyncContext *c, int status) { if (status != REDIS_OK) { - printf("Error: %s\n", c->error); + printf("Error: %s\n", c->errstr); } } @@ -26,9 +26,9 @@ int main (int argc, char **argv) { struct ev_loop *loop = ev_default_loop(0); redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379); - if (c->error != NULL) { + if (c->err) { /* Let *c leak for now... */ - printf("Error: %s\n", c->error); + printf("Error: %s\n", c->errstr); return 1; } diff --git a/example-libevent.c b/example-libevent.c index 8be78a1..c257bb6 100644 --- a/example-libevent.c +++ b/example-libevent.c @@ -17,7 +17,7 @@ void getCallback(redisAsyncContext *c, void *r, void *privdata) { void disconnectCallback(const redisAsyncContext *c, int status) { if (status != REDIS_OK) { - printf("Error: %s\n", c->error); + printf("Error: %s\n", c->errstr); } } @@ -26,9 +26,9 @@ int main (int argc, char **argv) { struct event_base *base = event_base_new(); redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379); - if (c->error != NULL) { + if (c->err) { /* Let *c leak for now... */ - printf("Error: %s\n", c->error); + printf("Error: %s\n", c->errstr); return 1; }