From 00b5c56f694af18113def2348c6f052cedee1603 Mon Sep 17 00:00:00 2001 From: lahiker42 Date: Wed, 15 Sep 2010 15:05:53 +0000 Subject: [PATCH] make protobuf_c_message_init() into a function (Issue #49) git-svn-id: https://protobuf-c.googlecode.com/svn/trunk@257 00440858-1255-0410-a3e6-75ea37f81c3a --- ChangeLog | 3 +++ src/google/protobuf-c/protobuf-c.c | 7 +++++++ src/google/protobuf-c/protobuf-c.h | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f10acde..acdd98c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +0.15 (NOT YET RELEASED) + - make protobuf_c_message_init() into a function (Issue #49, daveb) + 0.14: - build fix (missing dependency in test directory) - add generation / installation of pkg-config files. (Bobby Powers) diff --git a/src/google/protobuf-c/protobuf-c.c b/src/google/protobuf-c/protobuf-c.c index 4e4094f..3954129 100644 --- a/src/google/protobuf-c/protobuf-c.c +++ b/src/google/protobuf-c/protobuf-c.c @@ -2433,6 +2433,13 @@ protobuf_c_message_free_unpacked (ProtobufCMessage *message, FREE (allocator, message); } +void +protobuf_c_message_init (const ProtobufCMessageDescriptor *descriptor, + void *message) +{ + descriptor->message_init((ProtobufCMessage*) (message)); +} + /* === services === */ typedef void (*GenericHandler)(void *service, const ProtobufCMessage *input, diff --git a/src/google/protobuf-c/protobuf-c.h b/src/google/protobuf-c/protobuf-c.h index 98bd77b..ee1af6b 100644 --- a/src/google/protobuf-c/protobuf-c.h +++ b/src/google/protobuf-c/protobuf-c.h @@ -333,7 +333,8 @@ void protobuf_c_message_free_unpacked (ProtobufCMessage *message, /* WARNING: 'message' must be a block of memory of size descriptor->sizeof_message. */ -#define protobuf_c_message_init(descriptor, message) ((descriptor)->message_init((ProtobufCMessage*) (message))) +void protobuf_c_message_init (const ProtobufCMessageDescriptor *, + void *message); /* --- services --- */ typedef struct _ProtobufCMethodDescriptor ProtobufCMethodDescriptor;