Skip to content

Commit 4ddfce7

Browse files
committed
Problem: code was working against generators
We define the export_macro in models, for zproto. That generates it into the header file automatically. In this case it's FILEMQ_EXPORT, which is defined in filemq_library.h by zproto. Also the change to using czmq.lib instead of libczmq.lib seems wrong, as I'd rather we're building CZMQ correctly (to produce libczmq.lib). Solution: revert 2144420; define export_macro in client/server models, and regenerate all code.
1 parent bdf5c16 commit 4ddfce7

13 files changed

+98
-99
lines changed

Diff for: Findczmq.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
if (NOT MSVC)
77
include(FindPkgConfig)
8-
pkg_check_modules(PC_CZMQ "czmq")
8+
pkg_check_modules(PC_CZMQ "libczmq")
99
if (NOT PC_CZMQ_FOUND)
10-
pkg_check_modules(PC_CZMQ "czmq")
10+
pkg_check_modules(PC_CZMQ "libczmq")
1111
endif (NOT PC_CZMQ_FOUND)
1212
if (PC_CZMQ_FOUND)
1313
# some libraries install the headers is a subdirectory of the include dir

Diff for: Findlibsodium.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
if (NOT MSVC)
77
include(FindPkgConfig)
8-
pkg_check_modules(PC_LIBSODIUM "sodium")
8+
pkg_check_modules(PC_LIBSODIUM "libsodium")
99
if (NOT PC_LIBSODIUM_FOUND)
10-
pkg_check_modules(PC_LIBSODIUM "sodium")
10+
pkg_check_modules(PC_LIBSODIUM "libsodium")
1111
endif (NOT PC_LIBSODIUM_FOUND)
1212
if (PC_LIBSODIUM_FOUND)
1313
# some libraries install the headers is a subdirectory of the include dir

Diff for: Findlibzmq.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
if (NOT MSVC)
77
include(FindPkgConfig)
8-
pkg_check_modules(PC_LIBZMQ "zmq")
8+
pkg_check_modules(PC_LIBZMQ "libzmq")
99
if (NOT PC_LIBZMQ_FOUND)
10-
pkg_check_modules(PC_LIBZMQ "zmq")
10+
pkg_check_modules(PC_LIBZMQ "libzmq")
1111
endif (NOT PC_LIBZMQ_FOUND)
1212
if (PC_LIBZMQ_FOUND)
1313
# some libraries install the headers is a subdirectory of the include dir

Diff for: builds/msvc/vs2010/czmq.import.props

+9-9
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)' != ''">czmq.lib;%(AdditionalDependencies)</AdditionalDependencies>
28+
<AdditionalDependencies Condition="'$(Linkage-czmq)' != ''">libczmq.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\czmq.dll"
39-
DestinationFiles="$(TargetDir)czmq.dll"
38+
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\libczmq.dll"
39+
DestinationFiles="$(TargetDir)libczmq.dll"
4040
SkipUnchangedFiles="true" />
4141
<Copy Condition="$(Configuration.IndexOf('Debug')) != -1"
42-
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\czmq.pdb"
43-
DestinationFiles="$(TargetDir)czmq.pdb"
42+
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\libczmq.pdb"
43+
DestinationFiles="$(TargetDir)libczmq.pdb"
4444
SkipUnchangedFiles="true" />
4545
<Copy Condition="$(Configuration.IndexOf('Release')) != -1"
46-
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Release\$(PlatformToolset)\dynamic\czmq.dll"
47-
DestinationFiles="$(TargetDir)czmq.dll"
46+
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Release\$(PlatformToolset)\dynamic\libczmq.dll"
47+
DestinationFiles="$(TargetDir)libczmq.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 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" />
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" />
5656
</Target>
5757
<!--
5858
################################################################################

Diff for: configure.ac

+21-3
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ LIBS="${PREVIOUS_LIBS}"
220220
filemq_on_mingw32="no"
221221
filemq_on_cygwin="no"
222222
filemq_on_android="no"
223+
filemq_on_linux="no"
224+
filemq_on_gnu="no"
223225

224226
# Host specific checks
225227
AC_CANONICAL_HOST
@@ -266,6 +268,7 @@ case "${host_os}" in
266268
# Define on Linux to enable all library features
267269
CPPFLAGS="-D_GNU_SOURCE -DLINUX $CPPFLAGS"
268270
AC_DEFINE(FILEMQ_HAVE_LINUX, 1, [Have Linux OS])
271+
filemq_on_linux="yes"
269272

270273
case "${host_os}" in
271274
*android*)
@@ -324,6 +327,14 @@ case "${host_os}" in
324327
AC_DEFINE(FILEMQ_HAVE_CYGWIN, 1, [Have Cygwin])
325328
filemq_on_cygwin="yes"
326329
;;
330+
gnu*)
331+
# Define on GNU/Hurd to enable all library features
332+
if test "x$GXX" = "xyes"; then
333+
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
334+
fi
335+
AC_DEFINE(FILEMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])
336+
filemq_on_gnu="yes"
337+
;;
327338
*)
328339
AC_MSG_ERROR([unsupported system: ${host_os}.])
329340
;;
@@ -362,6 +373,8 @@ AM_CONDITIONAL(ENABLE_SHARED, test "x$enable_shared" = "xyes")
362373
AM_CONDITIONAL(ON_MINGW, test "x$filemq_on_mingw32" = "xyes")
363374
AM_CONDITIONAL(ON_CYGWIN, test "x$filemq_on_cygwin" = "xyes")
364375
AM_CONDITIONAL(ON_ANDROID, test "x$filemq_on_android" = "xyes")
376+
AM_CONDITIONAL(ON_LINUX, test "x$filemq_on_linux" = "xyes")
377+
AM_CONDITIONAL(ON_GNU, test "x$filemq_on_gnu" = "xyes")
365378
AM_CONDITIONAL(INSTALL_MAN, test "x$filemq_install_man" = "xyes")
366379
AM_CONDITIONAL(BUILD_DOC, test "x$filemq_build_doc" = "xyes")
367380

@@ -420,9 +433,14 @@ AM_COND_IF([WITH_SYSTEMD],
420433
[AC_MSG_ERROR([Cannot find required package for systemd. Note, pkg-config is required due to specified version >= 200])])],
421434
[])
422435

423-
# enable draft API by default if we're in a git repository
424-
# else disable it by default; then allow --with-draft=yes/no override
425-
AC_CHECK_FILE(.git, [gitmaster=yes], [gitmaster=no])
436+
if test "x$cross_compiling" = "xyes"; then
437+
# Enable draft by default when cross-compiling
438+
gitmaster=yes
439+
else
440+
# enable draft API by default if we're in a git repository
441+
# else disable it by default; then allow --with-draft=yes/no override
442+
AC_CHECK_FILE(.git, [gitmaster=yes], [gitmaster=no])
443+
fi
426444

427445
AC_ARG_WITH([drafts],
428446
AS_HELP_STRING([--with-drafts],

Diff for: include/filemq_library.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* =========================================================================
2-
filemq - FILEMQ wrapper
2+
filemq - generated layer of public API
33
44
Copyright (c) the Contributors as noted in the AUTHORS file.
55
This file is part of FileMQ, a C implemenation of the protocol:
@@ -50,7 +50,6 @@
5050
// Opaque class structures to allow forward references
5151

5252
// Draft APIs, excluded by default in stable releases
53-
#define WITH_DRAFTS
5453
#ifdef WITH_DRAFTS
5554
typedef struct _fmq_msg_t fmq_msg_t;
5655
#define FMQ_MSG_T_DEFINED
@@ -64,7 +63,6 @@ typedef struct _fmq_client_t fmq_client_t;
6463

6564
// Draft APIs, excluded by default in stable releases
6665
#ifdef WITH_DRAFTS
67-
#include "filemq_prelude.h"
6866
#include "fmq_msg.h"
6967
#include "fmq_server.h"
7068
#include "fmq_client.h"

Diff for: include/filemq_prelude.h

-17
This file was deleted.

Diff for: include/fmq_client.h

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* =========================================================================
2-
fmq_client - FILEMQ Client
2+
fmq_client - FileMQ Client
33
44
** WARNING *************************************************************
55
THIS SOURCE FILE IS 100% GENERATED. If you edit this file, you will lose
@@ -24,7 +24,6 @@
2424
#define FMQ_CLIENT_H_INCLUDED
2525

2626
#include <czmq.h>
27-
#include <filemq_prelude.h>
2827

2928
#ifdef __cplusplus
3029
extern "C" {
@@ -39,64 +38,64 @@ typedef struct _fmq_client_t fmq_client_t;
3938
// @interface
4039
// Create a new fmq_client, return the reference if successful, or NULL
4140
// if construction failed due to lack of available memory.
42-
FMQ_EXPORT fmq_client_t *
41+
FILEMQ_EXPORT fmq_client_t *
4342
fmq_client_new (void);
4443

4544
// Destroy the fmq_client and free all memory used by the object.
46-
FMQ_EXPORT void
45+
FILEMQ_EXPORT void
4746
fmq_client_destroy (fmq_client_t **self_p);
4847

4948
// Return actor, when caller wants to work with multiple actors and/or
5049
// input sockets asynchronously.
51-
FMQ_EXPORT zactor_t *
50+
FILEMQ_EXPORT zactor_t *
5251
fmq_client_actor (fmq_client_t *self);
5352

5453
// Return message pipe for asynchronous message I/O. In the high-volume case,
5554
// we send methods and get replies to the actor, in a synchronous manner, and
5655
// we send/recv high volume message data to a second pipe, the msgpipe. In
5756
// the low-volume case we can do everything over the actor pipe, if traffic
5857
// is never ambiguous.
59-
FMQ_EXPORT zsock_t *
58+
FILEMQ_EXPORT zsock_t *
6059
fmq_client_msgpipe (fmq_client_t *self);
6160

6261
// Return true if client is currently connected, else false. Note that the
6362
// client will automatically re-connect if the server dies and restarts after
6463
// a successful first connection.
65-
FMQ_EXPORT bool
64+
FILEMQ_EXPORT bool
6665
fmq_client_connected (fmq_client_t *self);
6766

6867
// Connect to server endpoint, with specified timeout in msecs (zero means wait
6968
// forever). Connect succeeds if connection is successful.
7069
// Returns >= 0 if successful, -1 if interrupted.
71-
FMQ_EXPORT uint8_t
70+
FILEMQ_EXPORT uint8_t
7271
fmq_client_connect (fmq_client_t *self, const char *endpoint, uint32_t timeout);
7372

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

7978
// Tell the api where to store files. This should be done before subscribing to
8079
// anything.
8180
// Returns >= 0 if successful, -1 if interrupted.
82-
FMQ_EXPORT uint8_t
81+
FILEMQ_EXPORT uint8_t
8382
fmq_client_set_inbox (fmq_client_t *self, const char *path);
8483

8584
// Return last received status
86-
FMQ_EXPORT uint8_t
85+
FILEMQ_EXPORT uint8_t
8786
fmq_client_status (fmq_client_t *self);
8887

8988
// Return last received reason
90-
FMQ_EXPORT const char *
89+
FILEMQ_EXPORT const char *
9190
fmq_client_reason (fmq_client_t *self);
9291

9392
// Self test of this class
94-
FMQ_EXPORT void
93+
FILEMQ_EXPORT void
9594
fmq_client_test (bool verbose);
9695

9796
// To enable verbose tracing (animation) of fmq_client instances, set
9897
// this to true. This lets you trace from and including construction.
99-
extern volatile int
98+
FILEMQ_EXPORT extern volatile int
10099
fmq_client_verbose;
101100
// @end
102101

0 commit comments

Comments
 (0)