Skip to content

Commit 996ef65

Browse files
committed
Merge pull request #71 from keent/master
Problem: FILEMQ doesn't build with MSVC without DRAFT_API defs and non-…
2 parents fd46a3e + 964d674 commit 996ef65

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

include/filemq_library.h

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
// Opaque class structures to allow forward references
5151

5252
// Draft APIs, excluded by default in stable releases
53+
#define WITH_DRAFTS
5354
#ifdef WITH_DRAFTS
5455
typedef struct _fmq_msg_t fmq_msg_t;
5556
#define FMQ_MSG_T_DEFINED

src/filemq_client.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@
33

44
int main (int argc, char *argv [])
55
{
6+
fmq_client_t *client;
7+
int rc;
8+
zsock_t *msgpipe;
9+
zpoller_t *poller;
10+
611
if (argc < 2) {
712
puts ("usage: filemq_client inbox-dir");
813
return 0;
914
}
1015

1116
// Create the client
12-
fmq_client_t *client = fmq_client_new ();
17+
client = fmq_client_new ();
1318
assert (client);
1419
fmq_client_verbose = 1;
1520

16-
int rc = fmq_client_connect (client, "tcp://localhost:5670", 1000);
21+
rc = fmq_client_connect (client, "tcp://localhost:5670", 1000);
1722
assert (rc == 0);
1823

1924
// Set the clients storage location
@@ -25,11 +30,11 @@ int main (int argc, char *argv [])
2530
assert (rc >= 0);
2631

2732
// Get a reference to the msgpipe
28-
zsock_t *msgpipe = fmq_client_msgpipe (client);
33+
msgpipe = fmq_client_msgpipe (client);
2934
assert (msgpipe);
3035

3136
// Setup a poller
32-
zpoller_t *poller = zpoller_new ( (void *) msgpipe, NULL);
37+
poller = zpoller_new ( (void *) msgpipe, NULL);
3338
assert (poller);
3439

3540
while (!zsys_interrupted) {

src/filemq_server.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
int main (int argc, char *argv [])
55
{
6+
zactor_t *server;
67
if (argc < 2) {
78
puts ("usage: filemq_server publish-from");
89
return 0;
910
}
10-
zactor_t *server = zactor_new (fmq_server, "filemq_server");
11+
server = zactor_new (fmq_server, "filemq_server");
1112

1213
//zstr_send (server, "VERBOSE");
1314
zstr_sendx (server, "PUBLISH", argv [1], "/", NULL);

0 commit comments

Comments
 (0)