fixed builder_cancel macro to return NULL on failed build
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -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_ @}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user