Permalink
Browse files

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.
  • Loading branch information...
hintjens committed Jan 21, 2016
1 parent bdf5c16 commit 4ddfce785b2fc2a9896c40cdea1561e6b95b9464
View
@@ -5,9 +5,9 @@
if (NOT MSVC)
include(FindPkgConfig)
pkg_check_modules(PC_CZMQ "czmq")
pkg_check_modules(PC_CZMQ "libczmq")
if (NOT PC_CZMQ_FOUND)
pkg_check_modules(PC_CZMQ "czmq")
pkg_check_modules(PC_CZMQ "libczmq")
endif (NOT PC_CZMQ_FOUND)
if (PC_CZMQ_FOUND)
# some libraries install the headers is a subdirectory of the include dir
View
@@ -5,9 +5,9 @@
if (NOT MSVC)
include(FindPkgConfig)
pkg_check_modules(PC_LIBSODIUM "sodium")
pkg_check_modules(PC_LIBSODIUM "libsodium")
if (NOT PC_LIBSODIUM_FOUND)
pkg_check_modules(PC_LIBSODIUM "sodium")
pkg_check_modules(PC_LIBSODIUM "libsodium")
endif (NOT PC_LIBSODIUM_FOUND)
if (PC_LIBSODIUM_FOUND)
# some libraries install the headers is a subdirectory of the include dir
View
@@ -5,9 +5,9 @@
if (NOT MSVC)
include(FindPkgConfig)
pkg_check_modules(PC_LIBZMQ "zmq")
pkg_check_modules(PC_LIBZMQ "libzmq")
if (NOT PC_LIBZMQ_FOUND)
pkg_check_modules(PC_LIBZMQ "zmq")
pkg_check_modules(PC_LIBZMQ "libzmq")
endif (NOT PC_LIBZMQ_FOUND)
if (PC_LIBZMQ_FOUND)
# some libraries install the headers is a subdirectory of the include dir
@@ -25,7 +25,7 @@
<PreprocessorDefinitions Condition="'$(Linkage-czmq)' == 'static' Or '$(Linkage-czmq)' == 'ltcg'">LIBCZMQ_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies Condition="'$(Linkage-czmq)' != ''">czmq.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Linkage-czmq)' != ''">libczmq.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="$(Configuration.IndexOf('Debug')) != -1">$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-czmq)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="$(Configuration.IndexOf('Release')) != -1">$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-czmq)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
@@ -35,24 +35,24 @@
<Target Name="Linkage-czmq-dynamic" AfterTargets="AfterBuild" Condition="'$(Linkage-czmq)' == 'dynamic'">
<Copy Condition="$(Configuration.IndexOf('Debug')) != -1"
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\czmq.dll"
DestinationFiles="$(TargetDir)czmq.dll"
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\libczmq.dll"
DestinationFiles="$(TargetDir)libczmq.dll"
SkipUnchangedFiles="true" />
<Copy Condition="$(Configuration.IndexOf('Debug')) != -1"
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\czmq.pdb"
DestinationFiles="$(TargetDir)czmq.pdb"
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\libczmq.pdb"
DestinationFiles="$(TargetDir)libczmq.pdb"
SkipUnchangedFiles="true" />
<Copy Condition="$(Configuration.IndexOf('Release')) != -1"
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Release\$(PlatformToolset)\dynamic\czmq.dll"
DestinationFiles="$(TargetDir)czmq.dll"
SourceFiles="$(ProjectDir)..\..\..\..\..\czmq\bin\$(PlatformName)\Release\$(PlatformToolset)\dynamic\libczmq.dll"
DestinationFiles="$(TargetDir)libczmq.dll"
SkipUnchangedFiles="true" />
</Target>
<!-- Messages -->
<Target Name="czmq-info" BeforeTargets="AfterBuild" Condition="'$(Linkage-czmq)' == 'dynamic'">
<Message Text="Copying czmq.dll -&gt; $(TargetDir)czmq.dll" Importance="high"/>
<Message Text="Copying czmq.pdb -&gt; $(TargetDir)czmq.pdb" Importance="high" Condition="$(Configuration.IndexOf('Debug')) != -1" />
<Message Text="Copying libczmq.dll -&gt; $(TargetDir)libczmq.dll" Importance="high"/>
<Message Text="Copying libczmq.pdb -&gt; $(TargetDir)libczmq.pdb" Importance="high" Condition="$(Configuration.IndexOf('Debug')) != -1" />
</Target>
<!--
################################################################################
View
@@ -220,6 +220,8 @@ LIBS="${PREVIOUS_LIBS}"
filemq_on_mingw32="no"
filemq_on_cygwin="no"
filemq_on_android="no"
filemq_on_linux="no"
filemq_on_gnu="no"
# Host specific checks
AC_CANONICAL_HOST
@@ -266,6 +268,7 @@ case "${host_os}" in
# Define on Linux to enable all library features
CPPFLAGS="-D_GNU_SOURCE -DLINUX $CPPFLAGS"
AC_DEFINE(FILEMQ_HAVE_LINUX, 1, [Have Linux OS])
filemq_on_linux="yes"
case "${host_os}" in
*android*)
@@ -324,6 +327,14 @@ case "${host_os}" in
AC_DEFINE(FILEMQ_HAVE_CYGWIN, 1, [Have Cygwin])
filemq_on_cygwin="yes"
;;
gnu*)
# Define on GNU/Hurd to enable all library features
if test "x$GXX" = "xyes"; then
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
fi
AC_DEFINE(FILEMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])
filemq_on_gnu="yes"
;;
*)
AC_MSG_ERROR([unsupported system: ${host_os}.])
;;
@@ -362,6 +373,8 @@ AM_CONDITIONAL(ENABLE_SHARED, test "x$enable_shared" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$filemq_on_mingw32" = "xyes")
AM_CONDITIONAL(ON_CYGWIN, test "x$filemq_on_cygwin" = "xyes")
AM_CONDITIONAL(ON_ANDROID, test "x$filemq_on_android" = "xyes")
AM_CONDITIONAL(ON_LINUX, test "x$filemq_on_linux" = "xyes")
AM_CONDITIONAL(ON_GNU, test "x$filemq_on_gnu" = "xyes")
AM_CONDITIONAL(INSTALL_MAN, test "x$filemq_install_man" = "xyes")
AM_CONDITIONAL(BUILD_DOC, test "x$filemq_build_doc" = "xyes")
@@ -420,9 +433,14 @@ AM_COND_IF([WITH_SYSTEMD],
[AC_MSG_ERROR([Cannot find required package for systemd. Note, pkg-config is required due to specified version >= 200])])],
[])
# enable draft API by default if we're in a git repository
# else disable it by default; then allow --with-draft=yes/no override
AC_CHECK_FILE(.git, [gitmaster=yes], [gitmaster=no])
if test "x$cross_compiling" = "xyes"; then
# Enable draft by default when cross-compiling
gitmaster=yes
else
# enable draft API by default if we're in a git repository
# else disable it by default; then allow --with-draft=yes/no override
AC_CHECK_FILE(.git, [gitmaster=yes], [gitmaster=no])
fi
AC_ARG_WITH([drafts],
AS_HELP_STRING([--with-drafts],
View
@@ -1,5 +1,5 @@
/* =========================================================================
filemq - FILEMQ wrapper
filemq - generated layer of public API
Copyright (c) the Contributors as noted in the AUTHORS file.
This file is part of FileMQ, a C implemenation of the protocol:
@@ -50,7 +50,6 @@
// Opaque class structures to allow forward references
// Draft APIs, excluded by default in stable releases
#define WITH_DRAFTS
#ifdef WITH_DRAFTS
typedef struct _fmq_msg_t fmq_msg_t;
#define FMQ_MSG_T_DEFINED
@@ -64,7 +63,6 @@ typedef struct _fmq_client_t fmq_client_t;
// Draft APIs, excluded by default in stable releases
#ifdef WITH_DRAFTS
#include "filemq_prelude.h"
#include "fmq_msg.h"
#include "fmq_server.h"
#include "fmq_client.h"
View

This file was deleted.

Oops, something went wrong.
View
@@ -1,5 +1,5 @@
/* =========================================================================
fmq_client - FILEMQ Client
fmq_client - FileMQ Client
** WARNING *************************************************************
THIS SOURCE FILE IS 100% GENERATED. If you edit this file, you will lose
@@ -24,7 +24,6 @@
#define FMQ_CLIENT_H_INCLUDED
#include <czmq.h>
#include <filemq_prelude.h>
#ifdef __cplusplus
extern "C" {
@@ -39,64 +38,64 @@ typedef struct _fmq_client_t fmq_client_t;
// @interface
// Create a new fmq_client, return the reference if successful, or NULL
// if construction failed due to lack of available memory.
FMQ_EXPORT fmq_client_t *
FILEMQ_EXPORT fmq_client_t *
fmq_client_new (void);
// Destroy the fmq_client and free all memory used by the object.
FMQ_EXPORT void
FILEMQ_EXPORT void
fmq_client_destroy (fmq_client_t **self_p);
// Return actor, when caller wants to work with multiple actors and/or
// input sockets asynchronously.
FMQ_EXPORT zactor_t *
FILEMQ_EXPORT zactor_t *
fmq_client_actor (fmq_client_t *self);
// Return message pipe for asynchronous message I/O. In the high-volume case,
// we send methods and get replies to the actor, in a synchronous manner, and
// we send/recv high volume message data to a second pipe, the msgpipe. In
// the low-volume case we can do everything over the actor pipe, if traffic
// is never ambiguous.
FMQ_EXPORT zsock_t *
FILEMQ_EXPORT zsock_t *
fmq_client_msgpipe (fmq_client_t *self);
// Return true if client is currently connected, else false. Note that the
// client will automatically re-connect if the server dies and restarts after
// a successful first connection.
FMQ_EXPORT bool
FILEMQ_EXPORT bool
fmq_client_connected (fmq_client_t *self);
// Connect to server endpoint, with specified timeout in msecs (zero means wait
// forever). Connect succeeds if connection is successful.
// Returns >= 0 if successful, -1 if interrupted.
FMQ_EXPORT uint8_t
FILEMQ_EXPORT uint8_t
fmq_client_connect (fmq_client_t *self, const char *endpoint, uint32_t timeout);
// Subscribe to a directory on the server, directory specified by path.
// Returns >= 0 if successful, -1 if interrupted.
FMQ_EXPORT uint8_t
FILEMQ_EXPORT uint8_t
fmq_client_subscribe (fmq_client_t *self, const char *path);
// Tell the api where to store files. This should be done before subscribing to
// anything.
// Returns >= 0 if successful, -1 if interrupted.
FMQ_EXPORT uint8_t
FILEMQ_EXPORT uint8_t
fmq_client_set_inbox (fmq_client_t *self, const char *path);
// Return last received status
FMQ_EXPORT uint8_t
FILEMQ_EXPORT uint8_t
fmq_client_status (fmq_client_t *self);
// Return last received reason
FMQ_EXPORT const char *
FILEMQ_EXPORT const char *
fmq_client_reason (fmq_client_t *self);
// Self test of this class
FMQ_EXPORT void
FILEMQ_EXPORT void
fmq_client_test (bool verbose);
// To enable verbose tracing (animation) of fmq_client instances, set
// this to true. This lets you trace from and including construction.
extern volatile int
FILEMQ_EXPORT extern volatile int
fmq_client_verbose;
// @end
Oops, something went wrong.

0 comments on commit 4ddfce7

Please sign in to comment.