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.
14 lines
221 B
C
14 lines
221 B
C
/*
|
|
* Tests if still compile if typedefs are redfefined in STATIC_ASSERTS when
|
|
* proto file includes another poto file
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <pb_encode.h>
|
|
#include "callbacks2.pb.h"
|
|
|
|
int main()
|
|
{
|
|
return 0;
|
|
}
|