Fix unused parameter warning when building without errmsg.

This commit is contained in:
Petteri Aimonen
2014-04-05 13:25:44 +03:00
parent b63e582bdb
commit 7880f308ea

6
pb.h
View File

@@ -500,7 +500,11 @@ struct _pb_extension_t {
* messages if not used.
*/
#ifdef PB_NO_ERRMSG
#define PB_RETURN_ERROR(stream,msg) return false
#define PB_RETURN_ERROR(stream,msg) \
do {\
UNUSED(stream); \
return false; \
} while(0)
#define PB_GET_ERROR(stream) "(errmsg disabled)"
#else
#define PB_RETURN_ERROR(stream,msg) \