Commit 63d8cd18 by Patrick Steinhardt

apply: remove use of variadic error macro

The macro `apply_err` is implemented as a variadic macro, which
are not defined by C89. Convert it to a variadic function,
instead.
parent 27b8b31e
......@@ -24,9 +24,6 @@
#include "reader.h"
#include "index.h"
#define apply_err(...) \
( git_error_set(GIT_ERROR_PATCH, __VA_ARGS__), GIT_EAPPLYFAIL )
typedef struct {
/* The lines that we allocate ourself are allocated out of the pool.
* (Lines may have been allocated out of the diff.)
......@@ -35,6 +32,18 @@ typedef struct {
git_vector lines;
} patch_image;
static int apply_err(const char *fmt, ...) GIT_FORMAT_PRINTF(1, 2);
static int apply_err(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
git_error_vset(GIT_ERROR_PATCH, fmt, ap);
va_end(ap);
return GIT_EAPPLYFAIL;
}
static void patch_line_init(
git_diff_line *out,
const char *in,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment