X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-compat-util.h;h=230e198fc35390fbccb496d2b74425382439dc4a;hb=d4c813d47d5c4f821a6947a29e4a480ec6522f44;hp=23f760331f9242e77fda10fce52f4c3b5be60676;hpb=97000ba6e21d25581222e11c36db4bb88c05adcd;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index 23f760331..230e198fc 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -215,10 +215,14 @@ extern char *gitbasename(char *); #define is_dir_sep(c) ((c) == '/') #endif -#if __HP_cc >= 61000 +#ifndef find_last_dir_sep +#define find_last_dir_sep(path) strrchr(path, '/') +#endif + +#if defined(__HP_cc) && (__HP_cc >= 61000) #define NORETURN __attribute__((noreturn)) #define NORETURN_PTR -#elif defined(__GNUC__) +#elif defined(__GNUC__) && !defined(NO_NORETURN) #define NORETURN __attribute__((__noreturn__)) #define NORETURN_PTR __attribute__((__noreturn__)) #elif defined(_MSC_VER) @@ -236,6 +240,7 @@ extern char *gitbasename(char *); /* General helper functions */ extern void vreportf(const char *prefix, const char *err, va_list params); +extern void vwritef(int fd, const char *prefix, const char *err, va_list params); extern NORETURN void usage(const char *err); extern NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2))); extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2))); @@ -244,6 +249,7 @@ extern int error(const char *err, ...) __attribute__((format (printf, 1, 2))); extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2))); extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params)); +extern void set_error_routine(void (*routine)(const char *err, va_list params)); extern int prefixcmp(const char *str, const char *prefix); extern int suffixcmp(const char *str, const char *suffix);