summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-11-02 13:17:42 -0800
committerJunio C Hamano <gitster@pobox.com>2020-11-02 13:17:42 -0800
commit01194384d6efd9ba401b9c6ff5249e8b83ae91af (patch)
tree163c2d2646cbe87df797cc5fe82d2d430fd23fd3 /git-compat-util.h
parent03cd25ecbdaea419c7d07163c8930a658a4f44d2 (diff)
parent5710dcce74ac2a8a8d6f8f131aaa498cb04aa253 (diff)
downloadgit-01194384d6efd9ba401b9c6ff5249e8b83ae91af.tar.gz
Merge branch 'jk/report-fn-typedef'
Code clean-up. * jk/report-fn-typedef: usage: define a type for a reporting function
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 7a0fb7a045..adfea06897 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -489,11 +489,13 @@ static inline int const_error(void)
#define error_errno(...) (error_errno(__VA_ARGS__), const_error())
#endif
-void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
-void set_error_routine(void (*routine)(const char *err, va_list params));
-extern void (*get_error_routine(void))(const char *err, va_list params);
-void set_warn_routine(void (*routine)(const char *warn, va_list params));
-extern void (*get_warn_routine(void))(const char *warn, va_list params);
+typedef void (*report_fn)(const char *, va_list params);
+
+void set_die_routine(NORETURN_PTR report_fn routine);
+void set_error_routine(report_fn routine);
+report_fn get_error_routine(void);
+void set_warn_routine(report_fn routine);
+report_fn get_warn_routine(void);
void set_die_is_recursing_routine(int (*routine)(void));
int starts_with(const char *str, const char *prefix);