summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h34
1 files changed, 24 insertions, 10 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 5637114b8d..104993b975 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -252,8 +252,10 @@ typedef unsigned long uintptr_t;
#ifdef PRECOMPOSE_UNICODE
#include "compat/precompose_utf8.h"
#else
-#define precompose_str(in,i_nfd2nfc)
-#define precompose_argv(c,v)
+static inline void precompose_argv(int argc, const char **argv)
+{
+ ; /* nothing */
+}
#define probe_utf8_pathname_composition()
#endif
@@ -270,7 +272,9 @@ struct itimerval {
#endif
#ifdef NO_SETITIMER
-#define setitimer(which,value,ovalue)
+static inline int setitimer(int which, const struct itimerval *value, struct itimerval *newvalue) {
+ return 0; /* pretend success */
+}
#endif
#ifndef NO_LIBGEN_H
@@ -485,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);
@@ -1231,8 +1237,14 @@ int warn_on_fopen_errors(const char *path);
#endif
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
-#define flockfile(fh)
-#define funlockfile(fh)
+static inline void flockfile(FILE *fh)
+{
+ ; /* nothing */
+}
+static inline void funlockfile(FILE *fh)
+{
+ ; /* nothing */
+}
#define getc_unlocked(fh) getc(fh)
#endif
@@ -1342,4 +1354,6 @@ static inline void *container_of_or_null_offset(void *ptr, size_t offset)
((uintptr_t)&(ptr)->member - (uintptr_t)(ptr))
#endif /* !__GNUC__ */
+void sleep_millisec(int millisec);
+
#endif