aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-12-01 09:17:22 +0900
committerJunio C Hamano <gitster@pobox.com>2022-12-01 09:17:22 +0900
commit4948ed473168a36d1ca03765c599e95258a29715 (patch)
treea4a05e99c224e034afcc9cffd81961ef0e5305fc
parent7452749a781d84244ecd08c6f6ca7e5df67dfce8 (diff)
parenta61c70a7c890f48678bab8964f9f8d2173fb414a (diff)
downloadgit-4948ed473168a36d1ca03765c599e95258a29715.tar.xz
Merge branch 'jk/avoid-redef-system-functions-2.30'
* jk/avoid-redef-system-functions-2.30 git-compat-util: avoid redefining system function names
-rw-r--r--git-compat-util.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index a76d0526f7..83ec7b7941 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -341,11 +341,12 @@ struct itimerval {
#endif
#ifdef NO_SETITIMER
-static inline int setitimer(int which UNUSED,
- const struct itimerval *value UNUSED,
- struct itimerval *newvalue UNUSED) {
+static inline int git_setitimer(int which UNUSED,
+ const struct itimerval *value UNUSED,
+ struct itimerval *newvalue UNUSED) {
return 0; /* pretend success */
}
+#define setitimer(which,value,ovalue) git_setitimer(which,value,ovalue)
#endif
#ifndef NO_LIBGEN_H
@@ -1471,14 +1472,16 @@ int open_nofollow(const char *path, int flags);
#endif
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
-static inline void flockfile(FILE *fh UNUSED)
+static inline void git_flockfile(FILE *fh UNUSED)
{
; /* nothing */
}
-static inline void funlockfile(FILE *fh UNUSED)
+static inline void git_funlockfile(FILE *fh UNUSED)
{
; /* nothing */
}
+#define flockfile(fh) git_flockfile(fh)
+#define funlockfile(fh) git_funlockfile(fh)
#define getc_unlocked(fh) getc(fh)
#endif