From cc29958d34e43ed889536ad4a723fce819544785 Mon Sep 17 00:00:00 2001 From: Steffen Siering Date: Sun, 11 Nov 2012 22:48:21 +0000 Subject: Fix STATIC_ASSERT macro when using multiple .proto files. The __COUNTER__ macro (used for generating unique names) is at least supported by gcc, clang and Visual Studio. With this change test_compiles.c is compilable, since no more typedefs are redefined. Compilers/Preprocessors not supporting __COUNTER__ error's are still possible which are hopfully handled by the usage of __LINE__ in most sittuations. Added unit test for the problem. --- tests/callbacks2.proto | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/callbacks2.proto (limited to 'tests/callbacks2.proto') diff --git a/tests/callbacks2.proto b/tests/callbacks2.proto new file mode 100644 index 00000000..9a55e15a --- /dev/null +++ b/tests/callbacks2.proto @@ -0,0 +1,9 @@ +// Test if including generated header file for this file + implicit include of +// callbacks.pb.h still compiles. Used with test_compiles.c. +import "callbacks.proto"; + +message Callback2Message { + required TestMessage tstmsg = 1; + required SubMessage submsg = 2; +} + -- cgit