Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-12-19 05:46:16 +0300
committerJunio C Hamano <gitster@pobox.com>2022-12-19 05:46:16 +0300
commitefcc48efa7337cdd7e60ba19ad0e07766e5e8cd3 (patch)
tree33bff46759559882f96541c1ae955e8b0f4f46d5 /git-compat-util.h
parent3c0a9886724be4624ec2c16078629acadddd66a3 (diff)
parente1a95b78d8a26762ea04332de8b7c3878da51522 (diff)
Merge branch 'jk/avoid-redef-system-functions-2.30'
Redefining system functions for a few functions did not follow our usual "implement git_foo() and #define foo(args) git_foo(args)" pattern, which has broken build for some folks. * jk/avoid-redef-system-functions-2.30: git-compat-util: undefine system names before redeclaring them git-compat-util: avoid redefining system function names
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index a76d0526f7..76e4b11131 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -341,11 +341,13 @@ 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 */
}
+#undef setitimer
+#define setitimer(which,value,ovalue) git_setitimer(which,value,ovalue)
#endif
#ifndef NO_LIBGEN_H
@@ -1471,14 +1473,19 @@ 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 */
}
+#undef flockfile
+#undef funlockfile
+#undef getc_unlocked
+#define flockfile(fh) git_flockfile(fh)
+#define funlockfile(fh) git_funlockfile(fh)
#define getc_unlocked(fh) getc(fh)
#endif