Skip to content

Commit

Permalink
Fixed setsockopt.c to work with ZeroMQ/3.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hintjens committed Oct 23, 2012
1 parent 888ae22 commit c443053
Show file tree
Hide file tree
Showing 2 changed files with 268 additions and 123 deletions.
9 changes: 6 additions & 3 deletions sockopts.gsl
Expand Up @@ -165,9 +165,7 @@ int zsockopt_test (Bool verbose);
void
zsocket_set_$(name) (void *zocket, $(ctype) $(name))
{
# if !defined (ZMQ_$(NAME))
# define ZMQ_$(NAME) 999 // Using an out-of-date libzmq
# endif
# if defined (ZMQ_$(NAME))
. if count (restrict)
. for restrict
. if first()
Expand Down Expand Up @@ -203,6 +201,7 @@ zsocket_set_$(name) (void *zocket, $(ctype) $(name))
int rc = zmq_setsockopt (zocket, ZMQ_$(NAME), $(name), strlen ($(name)));
. endif
assert (rc == 0 || errno == ETERM);
# endif
}


Expand All @@ -214,6 +213,7 @@ zsocket_set_$(name) (void *zocket, $(ctype) $(name))
$(ctype)
zsocket_$(name) (void *zocket)
{
# if defined (ZMQ_$(NAME))
. if type = "uint64"
uint64_t $(name);
size_t option_len = sizeof (uint64_t);
Expand All @@ -240,6 +240,7 @@ zsocket_$(name) (void *zocket)
. else
return ($(ctype)) $(name);
. endif
# endif
}


Expand Down Expand Up @@ -273,6 +274,7 @@ zsockopt_test (Bool verbose)
. if defined (.minor)
# if (ZMQ_VERSION_MINOR == $(minor))
. endif
# if defined (ZMQ_$(NAME))
zocket = zsocket_new (ctx, ZMQ_$(TEST));
assert (zocket);
. if mode = "rw" | mode = "w"
Expand All @@ -295,6 +297,7 @@ zsockopt_test (Bool verbose)
. endif
. endif
zsocket_destroy (ctx, zocket);
# endif
. if defined (.minor)
# endif
. endif
Expand Down

0 comments on commit c443053

Please sign in to comment.