aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-02-28 16:23:26 -0800
committerGarrett D'Amore <garrett@damore.org>2018-02-28 16:23:26 -0800
commit04e5a756ba25f79036aa5e03e7412ed5e5539a12 (patch)
treed33d3cf0f48de6103f8ee96d5e7fc1afba0071a5 /tools
parent4f2b13b588e4a3dd611aae525e59fa0b46fba263 (diff)
downloadnng-04e5a756ba25f79036aa5e03e7412ed5e5539a12.tar.gz
nng-04e5a756ba25f79036aa5e03e7412ed5e5539a12.tar.bz2
nng-04e5a756ba25f79036aa5e03e7412ed5e5539a12.zip
fixes #250 nngcat may not build if protocols are missing
Diffstat (limited to 'tools')
-rw-r--r--tools/nngcat/nngcat.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/nngcat/nngcat.c b/tools/nngcat/nngcat.c
index 4e61d41a..728f0c3f 100644
--- a/tools/nngcat/nngcat.c
+++ b/tools/nngcat/nngcat.c
@@ -787,37 +787,81 @@ main(int ac, const char **av)
switch (proto) {
case OPT_REQ0:
+#ifdef NNG_HAVE_REQ0
rv = nng_req0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_REP0:
+#ifdef NNG_HAVE_REP0
rv = nng_rep0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_SUB0:
+#ifdef NNG_HAVE_SUB0
rv = nng_sub0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_PUB0:
+#ifdef NNG_HAVE_PUB0
rv = nng_pub0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_PAIR0:
+#ifdef NNG_HAVE_PAIR0
rv = nng_pair0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_PAIR1:
+#ifdef NNG_HAVE_PAIR1
rv = nng_pair1_open(&sock);
+#else
+ fatal("Protocol not supported");
+#endif
break;
case OPT_BUS0:
+#ifdef NNG_HAVE_BUS0
rv = nng_bus0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_PUSH0:
+#ifdef NNG_HAVE_PUSH0
rv = nng_push0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_PULL0:
+#ifdef NNG_HAVE_PULL0
rv = nng_pull0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_SURVEY0:
+#ifdef NNG_HAVE_SURVEYOR0
rv = nng_surveyor0_open(&sock);
+#else
+ fatal("Protocol not supported.");
+#endif
break;
case OPT_RESPOND0:
+#ifdef NNG_HAVE_RESPONDENT0
rv = nng_respondent0_open(&sock);
+#else
+ fatal("Protocol not supported");
+#endif
break;
case 0:
default: