fixed builder_cancel macro to return NULL on failed build

This commit is contained in:
Martin Willi
2008-10-06 13:08:49 +00:00
parent aa1b90a5b2
commit 0592212f23
2 changed files with 15 additions and 1 deletions
+9
View File
@@ -37,3 +37,12 @@ ENUM(builder_part_names, BUILD_FROM_FILE, BUILD_END,
"BUILD_X509_FLAG", "BUILD_X509_FLAG",
"BUILD_END", "BUILD_END",
); );
/**
* See header.
*/
void* builder_free(builder_t *this)
{
free(this);
return NULL;
}
+6 -1
View File
@@ -118,6 +118,11 @@ struct builder_t {
* Helper macro to cancel a build in a builder * Helper macro to cancel a build in a builder
*/ */
#define builder_cancel(builder) { (builder)->add = (void*)nop; \ #define builder_cancel(builder) { (builder)->add = (void*)nop; \
(builder)->build = (void*)free; } (builder)->build = (void*)builder_free; }
/**
* Helper function for a cancelled build.
*/
void* builder_free(builder_t *this);
#endif /* BUILDER_H_ @}*/ #endif /* BUILDER_H_ @}*/