Skip to content

Commit a61c70a

Browse files
committed
Merge branch 'jk/avoid-redef-system-functions-2.30' into maint
* jk/avoid-redef-system-functions-2.30: git-compat-util: avoid redefining system function names
2 parents e7e5c6f + e0c08a4 commit a61c70a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

git-compat-util.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,12 @@ struct itimerval {
338338
#endif
339339

340340
#ifdef NO_SETITIMER
341-
static inline int setitimer(int which, const struct itimerval *value, struct itimerval *newvalue) {
341+
static inline int git_setitimer(int which,
342+
const struct itimerval *value,
343+
struct itimerval *newvalue) {
342344
return 0; /* pretend success */
343345
}
346+
#define setitimer(which,value,ovalue) git_setitimer(which,value,ovalue)
344347
#endif
345348

346349
#ifndef NO_LIBGEN_H
@@ -1466,14 +1469,16 @@ int open_nofollow(const char *path, int flags);
14661469
#endif
14671470

14681471
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
1469-
static inline void flockfile(FILE *fh)
1472+
static inline void git_flockfile(FILE *fh)
14701473
{
14711474
; /* nothing */
14721475
}
1473-
static inline void funlockfile(FILE *fh)
1476+
static inline void git_funlockfile(FILE *fh)
14741477
{
14751478
; /* nothing */
14761479
}
1480+
#define flockfile(fh) git_flockfile(fh)
1481+
#define funlockfile(fh) git_funlockfile(fh)
14771482
#define getc_unlocked(fh) getc(fh)
14781483
#endif
14791484

0 commit comments

Comments
 (0)