Skip to content

Commit bdf5c16

Browse files
committed
Merge pull request #69 from keent/master
Problem: libfilemq not building properly
2 parents ba937e2 + 2144420 commit bdf5c16

File tree

6 files changed

+82
-61
lines changed

6 files changed

+82
-61
lines changed

builds/msvc/vs2010/czmq.import.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<PreprocessorDefinitions Condition="'$(Linkage-czmq)' == 'static' Or '$(Linkage-czmq)' == 'ltcg'">LIBCZMQ_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2626
</ClCompile>
2727
<Link>
28-
<AdditionalDependencies Condition="'$(Linkage-czmq)' != ''">libczmq.lib;%(AdditionalDependencies)</AdditionalDependencies>
28+
<AdditionalDependencies Condition="'$(Linkage-czmq)' != ''">czmq.lib;%(AdditionalDependencies)</AdditionalDependencies>
2929
<AdditionalLibraryDirectories Condition="$(Configuration.IndexOf('Debug')) != -1">$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-czmq)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
3030
<AdditionalLibraryDirectories Condition="$(Configuration.IndexOf('Release')) != -1">$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-czmq)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
3131
</Link>
@@ -35,24 +35,24 @@
3535

3636
<Target Name="Linkage-czmq-dynamic" AfterTargets="AfterBuild" Condition="'$(Linkage-czmq)' == 'dynamic'">
3737
<Copy Condition="$(Configuration.IndexOf('Debug')) != -1"
38-
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\libczmq.dll"
39-
DestinationFiles="$(TargetDir)libczmq.dll"
38+
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\czmq.dll"
39+
DestinationFiles="$(TargetDir)czmq.dll"
4040
SkipUnchangedFiles="true" />
4141
<Copy Condition="$(Configuration.IndexOf('Debug')) != -1"
42-
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\libczmq.pdb"
43-
DestinationFiles="$(TargetDir)libczmq.pdb"
42+
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\czmq.pdb"
43+
DestinationFiles="$(TargetDir)czmq.pdb"
4444
SkipUnchangedFiles="true" />
4545
<Copy Condition="$(Configuration.IndexOf('Release')) != -1"
46-
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Release\$(PlatformToolset)\dynamic\libczmq.dll"
47-
DestinationFiles="$(TargetDir)libczmq.dll"
46+
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Release\$(PlatformToolset)\dynamic\czmq.dll"
47+
DestinationFiles="$(TargetDir)czmq.dll"
4848
SkipUnchangedFiles="true" />
4949
</Target>
5050

5151
<!-- Messages -->
5252

5353
<Target Name="czmq-info" BeforeTargets="AfterBuild" Condition="'$(Linkage-czmq)' == 'dynamic'">
54-
<Message Text="Copying libczmq.dll -&gt; $(TargetDir)libczmq.dll" Importance="high"/>
55-
<Message Text="Copying libczmq.pdb -&gt; $(TargetDir)libczmq.pdb" Importance="high" Condition="$(Configuration.IndexOf('Debug')) != -1" />
54+
<Message Text="Copying czmq.dll -&gt; $(TargetDir)czmq.dll" Importance="high"/>
55+
<Message Text="Copying czmq.pdb -&gt; $(TargetDir)czmq.pdb" Importance="high" Condition="$(Configuration.IndexOf('Debug')) != -1" />
5656
</Target>
5757
<!--
5858
################################################################################

include/filemq_library.h

Lines changed: 2 additions & 0 deletions
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
@@ -63,6 +64,7 @@ typedef struct _fmq_client_t fmq_client_t;
6364

6465
// Draft APIs, excluded by default in stable releases
6566
#ifdef WITH_DRAFTS
67+
#include "filemq_prelude.h"
6668
#include "fmq_msg.h"
6769
#include "fmq_server.h"
6870
#include "fmq_client.h"

include/filemq_prelude.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//- Non-portable declaration specifiers -------------------------------------
2+
3+
#define LIBFMQ_EXPORTS // temporary declaration
4+
5+
#if defined (__WINDOWS__)
6+
# if defined LIBFMQ_STATIC
7+
# define FMQ_EXPORT
8+
# elif defined LIBFMQ_EXPORTS
9+
# define FMQ_EXPORT __declspec(dllexport)
10+
# else
11+
# define FMQ_EXPORT __declspec(dllimport)
12+
# endif
13+
#else
14+
# define FMQ_EXPORT
15+
#endif
16+
17+

include/fmq_client.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define FMQ_CLIENT_H_INCLUDED
2525

2626
#include <czmq.h>
27+
#include <filemq_prelude.h>
2728

2829
#ifdef __cplusplus
2930
extern "C" {
@@ -38,59 +39,59 @@ typedef struct _fmq_client_t fmq_client_t;
3839
// @interface
3940
// Create a new fmq_client, return the reference if successful, or NULL
4041
// if construction failed due to lack of available memory.
41-
fmq_client_t *
42+
FMQ_EXPORT fmq_client_t *
4243
fmq_client_new (void);
4344

4445
// Destroy the fmq_client and free all memory used by the object.
45-
void
46+
FMQ_EXPORT void
4647
fmq_client_destroy (fmq_client_t **self_p);
4748

4849
// Return actor, when caller wants to work with multiple actors and/or
4950
// input sockets asynchronously.
50-
zactor_t *
51+
FMQ_EXPORT zactor_t *
5152
fmq_client_actor (fmq_client_t *self);
5253

5354
// Return message pipe for asynchronous message I/O. In the high-volume case,
5455
// we send methods and get replies to the actor, in a synchronous manner, and
5556
// we send/recv high volume message data to a second pipe, the msgpipe. In
5657
// the low-volume case we can do everything over the actor pipe, if traffic
5758
// is never ambiguous.
58-
zsock_t *
59+
FMQ_EXPORT zsock_t *
5960
fmq_client_msgpipe (fmq_client_t *self);
6061

6162
// Return true if client is currently connected, else false. Note that the
6263
// client will automatically re-connect if the server dies and restarts after
6364
// a successful first connection.
64-
bool
65+
FMQ_EXPORT bool
6566
fmq_client_connected (fmq_client_t *self);
6667

6768
// Connect to server endpoint, with specified timeout in msecs (zero means wait
6869
// forever). Connect succeeds if connection is successful.
6970
// Returns >= 0 if successful, -1 if interrupted.
70-
uint8_t
71+
FMQ_EXPORT uint8_t
7172
fmq_client_connect (fmq_client_t *self, const char *endpoint, uint32_t timeout);
7273

7374
// Subscribe to a directory on the server, directory specified by path.
7475
// Returns >= 0 if successful, -1 if interrupted.
75-
uint8_t
76+
FMQ_EXPORT uint8_t
7677
fmq_client_subscribe (fmq_client_t *self, const char *path);
7778

7879
// Tell the api where to store files. This should be done before subscribing to
7980
// anything.
8081
// Returns >= 0 if successful, -1 if interrupted.
81-
uint8_t
82+
FMQ_EXPORT uint8_t
8283
fmq_client_set_inbox (fmq_client_t *self, const char *path);
8384

8485
// Return last received status
85-
uint8_t
86+
FMQ_EXPORT uint8_t
8687
fmq_client_status (fmq_client_t *self);
8788

8889
// Return last received reason
89-
const char *
90+
FMQ_EXPORT const char *
9091
fmq_client_reason (fmq_client_t *self);
9192

9293
// Self test of this class
93-
void
94+
FMQ_EXPORT void
9495
fmq_client_test (bool verbose);
9596

9697
// To enable verbose tracing (animation) of fmq_client instances, set

include/fmq_msg.h

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
#define FMQ_MSG_RTFM 129
8484

8585
#include <czmq.h>
86+
#include <filemq_prelude.h>
8687

8788
#ifdef __cplusplus
8889
extern "C" {
@@ -96,131 +97,131 @@ typedef struct _fmq_msg_t fmq_msg_t;
9697

9798
// @interface
9899
// Create a new empty fmq_msg
99-
fmq_msg_t *
100+
FMQ_EXPORT fmq_msg_t *
100101
fmq_msg_new (void);
101102

102103
// Destroy a fmq_msg instance
103-
void
104+
FMQ_EXPORT void
104105
fmq_msg_destroy (fmq_msg_t **self_p);
105106

106107
// Receive a fmq_msg from the socket. Returns 0 if OK, -1 if
107108
// there was an error. Blocks if there is no message waiting.
108-
int
109+
FMQ_EXPORT int
109110
fmq_msg_recv (fmq_msg_t *self, zsock_t *input);
110111

111112
// Send the fmq_msg to the output socket, does not destroy it
112-
int
113+
FMQ_EXPORT int
113114
fmq_msg_send (fmq_msg_t *self, zsock_t *output);
114115

115116

116117
// Print contents of message to stdout
117-
void
118+
FMQ_EXPORT void
118119
fmq_msg_print (fmq_msg_t *self);
119120

120121
// Get/set the message routing id
121-
zframe_t *
122+
FMQ_EXPORT zframe_t *
122123
fmq_msg_routing_id (fmq_msg_t *self);
123-
void
124+
FMQ_EXPORT void
124125
fmq_msg_set_routing_id (fmq_msg_t *self, zframe_t *routing_id);
125126

126127
// Get the fmq_msg id and printable command
127-
int
128+
FMQ_EXPORT int
128129
fmq_msg_id (fmq_msg_t *self);
129-
void
130+
FMQ_EXPORT void
130131
fmq_msg_set_id (fmq_msg_t *self, int id);
131-
const char *
132+
FMQ_EXPORT const char *
132133
fmq_msg_command (fmq_msg_t *self);
133134

134135
// Get/set the path field
135-
const char *
136+
FMQ_EXPORT const char *
136137
fmq_msg_path (fmq_msg_t *self);
137-
void
138+
FMQ_EXPORT void
138139
fmq_msg_set_path (fmq_msg_t *self, const char *value);
139140

140141
// Get a copy of the options field
141-
zhash_t *
142+
FMQ_EXPORT zhash_t *
142143
fmq_msg_options (fmq_msg_t *self);
143144
// Get the options field and transfer ownership to caller
144-
zhash_t *
145+
FMQ_EXPORT zhash_t *
145146
fmq_msg_get_options (fmq_msg_t *self);
146147
// Set the options field, transferring ownership from caller
147-
void
148+
FMQ_EXPORT void
148149
fmq_msg_set_options (fmq_msg_t *self, zhash_t **hash_p);
149150

150151
// Get a copy of the cache field
151-
zhash_t *
152+
FMQ_EXPORT zhash_t *
152153
fmq_msg_cache (fmq_msg_t *self);
153154
// Get the cache field and transfer ownership to caller
154-
zhash_t *
155+
FMQ_EXPORT zhash_t *
155156
fmq_msg_get_cache (fmq_msg_t *self);
156157
// Set the cache field, transferring ownership from caller
157-
void
158+
FMQ_EXPORT void
158159
fmq_msg_set_cache (fmq_msg_t *self, zhash_t **hash_p);
159160

160161
// Get/set the credit field
161-
uint64_t
162+
FMQ_EXPORT uint64_t
162163
fmq_msg_credit (fmq_msg_t *self);
163-
void
164+
FMQ_EXPORT void
164165
fmq_msg_set_credit (fmq_msg_t *self, uint64_t credit);
165166

166167
// Get/set the sequence field
167-
uint64_t
168+
FMQ_EXPORT uint64_t
168169
fmq_msg_sequence (fmq_msg_t *self);
169-
void
170+
FMQ_EXPORT void
170171
fmq_msg_set_sequence (fmq_msg_t *self, uint64_t sequence);
171172

172173
// Get/set the operation field
173-
byte
174+
FMQ_EXPORT byte
174175
fmq_msg_operation (fmq_msg_t *self);
175-
void
176+
FMQ_EXPORT void
176177
fmq_msg_set_operation (fmq_msg_t *self, byte operation);
177178

178179
// Get/set the filename field
179-
const char *
180+
FMQ_EXPORT const char *
180181
fmq_msg_filename (fmq_msg_t *self);
181-
void
182+
FMQ_EXPORT void
182183
fmq_msg_set_filename (fmq_msg_t *self, const char *value);
183184

184185
// Get/set the offset field
185-
uint64_t
186+
FMQ_EXPORT uint64_t
186187
fmq_msg_offset (fmq_msg_t *self);
187-
void
188+
FMQ_EXPORT void
188189
fmq_msg_set_offset (fmq_msg_t *self, uint64_t offset);
189190

190191
// Get/set the eof field
191-
byte
192+
FMQ_EXPORT byte
192193
fmq_msg_eof (fmq_msg_t *self);
193-
void
194+
FMQ_EXPORT void
194195
fmq_msg_set_eof (fmq_msg_t *self, byte eof);
195196

196197
// Get a copy of the headers field
197-
zhash_t *
198+
FMQ_EXPORT zhash_t *
198199
fmq_msg_headers (fmq_msg_t *self);
199200
// Get the headers field and transfer ownership to caller
200-
zhash_t *
201+
FMQ_EXPORT zhash_t *
201202
fmq_msg_get_headers (fmq_msg_t *self);
202203
// Set the headers field, transferring ownership from caller
203-
void
204+
FMQ_EXPORT void
204205
fmq_msg_set_headers (fmq_msg_t *self, zhash_t **hash_p);
205206

206207
// Get a copy of the chunk field
207-
zchunk_t *
208+
FMQ_EXPORT zchunk_t *
208209
fmq_msg_chunk (fmq_msg_t *self);
209210
// Get the chunk field and transfer ownership to caller
210-
zchunk_t *
211+
FMQ_EXPORT zchunk_t *
211212
fmq_msg_get_chunk (fmq_msg_t *self);
212213
// Set the chunk field, transferring ownership from caller
213-
void
214+
FMQ_EXPORT void
214215
fmq_msg_set_chunk (fmq_msg_t *self, zchunk_t **chunk_p);
215216

216217
// Get/set the reason field
217-
const char *
218+
FMQ_EXPORT const char *
218219
fmq_msg_reason (fmq_msg_t *self);
219-
void
220+
FMQ_EXPORT void
220221
fmq_msg_set_reason (fmq_msg_t *self, const char *value);
221222

222223
// Self test of this class
223-
void
224+
FMQ_EXPORT void
224225
fmq_msg_test (bool verbose);
225226
// @end
226227

include/fmq_server.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ extern "C" {
8080
//
8181
// This is the fmq_server constructor as a zactor_fn:
8282
//
83-
void
83+
FMQ_EXPORT void
8484
fmq_server (zsock_t *pipe, void *args);
8585

8686
// Self test of this class
87-
void
87+
FMQ_EXPORT void
8888
fmq_server_test (bool verbose);
8989
// @end
9090

0 commit comments

Comments
 (0)