X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=pb.h;h=fbdf185e850cf809b9bc2a940bd43caea97819ac;hb=bb5dc04584f4e147cf3c892ab004ecd36ba7642b;hp=1be8d4ed23abbd8c1a36d9ff5dc1b016e13cdd8e;hpb=92bb37b07420d0d3b7cb1fe62f3cb6fcc84d8bbf;p=apps%2Fagl-service-can-low-level.git diff --git a/pb.h b/pb.h index 1be8d4ed..fbdf185e 100644 --- a/pb.h +++ b/pb.h @@ -6,7 +6,7 @@ * see pb_encode.h or pb_decode.h */ -#define NANOPB_VERSION nanopb-0.1.7 +#define NANOPB_VERSION nanopb-0.1.9-dev #include #include @@ -24,9 +24,13 @@ #define UNUSED(x) (void)(x) #endif -/* Compile-time assertion, used for checking compatible compilation options. */ +/* Compile-time assertion, used for checking compatible compilation options. + * If this fails on your compiler for some reason, use #define STATIC_ASSERT + * to disable it. */ #ifndef STATIC_ASSERT -#define STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND)?1:-1]; +#define STATIC_ASSERT(COND,MSG) typedef char STATIC_ASSERT_MSG(MSG, __LINE__, __COUNTER__)[(COND)?1:-1]; +#define STATIC_ASSERT_MSG(MSG, LINE, COUNTER) STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) +#define STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) static_assertion_##MSG##LINE##COUNTER #endif /* Number of required fields to keep track of