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;