summaryrefslogtreecommitdiff
path: root/src/msg.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-05-03 23:20:43 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-05-03 23:20:43 +0200
commitceb5e1a0734b0c73bd7f74ec5094ae6ad4f9dfc4 (patch)
treef051d16958ee71d418e4899c500e355d4acd9601 /src/msg.hpp
parent5e329ba7cac8a52fbbd2c347064c2d9355009022 (diff)
Deallocation functions in zmq.h and msg_t class are consistent.
The two functions had different calling conventions (C vs. C++). It is fixed now. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/msg.hpp')
-rw-r--r--src/msg.hpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/msg.hpp b/src/msg.hpp
index b7d21f6..466a96a 100644
--- a/src/msg.hpp
+++ b/src/msg.hpp
@@ -26,6 +26,14 @@
#include "config.hpp"
#include "atomic_counter.hpp"
+// Signature for free function to deallocate the message content.
+// Note that it has to be declared as "C" so that it is the same as
+// zmq_free_fn defined in zmq.h.
+extern "C"
+{
+ typedef void (msg_free_fn) (void *data, void *hint);
+}
+
namespace zmq
{
@@ -43,13 +51,10 @@ namespace zmq
shared = 128
};
- // Signature for free function to deallocate the message content.
- typedef void (free_fn_t) (void *data, void *hint);
-
bool check ();
int init ();
int init_size (size_t size_);
- int init_data (void *data_, size_t size_, free_fn_t *ffn_,
+ int init_data (void *data_, size_t size_, msg_free_fn *ffn_,
void *hint_);
int init_delimiter ();
int close ();
@@ -82,7 +87,7 @@ namespace zmq
{
void *data;
size_t size;
- free_fn_t *ffn;
+ msg_free_fn *ffn;
void *hint;
zmq::atomic_counter_t refcnt;
};