protobuf-c.c: wrap DO_ALLOC macro in a do {} while(0) statement

This commit is contained in:
Ilya Lipnitskiy 2013-12-02 15:43:08 -08:00
parent 3ec5aa1256
commit 5b3ac9ca97

View File

@ -92,6 +92,7 @@ alloc_failed_warning (unsigned size, const char *filename, unsigned line)
/* Try to allocate memory, running some special code if it fails. */
#define DO_ALLOC(dst, allocator, size, fail_code) \
do \
{ size_t da__allocation_size = (size); \
if (da__allocation_size == 0) \
dst = NULL; \
@ -101,7 +102,7 @@ alloc_failed_warning (unsigned size, const char *filename, unsigned line)
alloc_failed_warning (da__allocation_size, __FILE__, __LINE__); \
fail_code; \
} \
}
} while(0)
#define DO_UNALIGNED_ALLOC DO_ALLOC /* placeholder */