Skip to content

Commit 4948ed4

Browse files
committed
Merge branch 'jk/avoid-redef-system-functions-2.30'
* jk/avoid-redef-system-functions-2.30 git-compat-util: avoid redefining system function names
2 parents 7452749 + a61c70a commit 4948ed4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

git-compat-util.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,12 @@ struct itimerval {
341341
#endif
342342

343343
#ifdef NO_SETITIMER
344-
static inline int setitimer(int which UNUSED,
345-
const struct itimerval *value UNUSED,
346-
struct itimerval *newvalue UNUSED) {
344+
static inline int git_setitimer(int which UNUSED,
345+
const struct itimerval *value UNUSED,
346+
struct itimerval *newvalue UNUSED) {
347347
return 0; /* pretend success */
348348
}
349+
#define setitimer(which,value,ovalue) git_setitimer(which,value,ovalue)
349350
#endif
350351

351352
#ifndef NO_LIBGEN_H
@@ -1471,14 +1472,16 @@ int open_nofollow(const char *path, int flags);
14711472
#endif
14721473

14731474
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
1474-
static inline void flockfile(FILE *fh UNUSED)
1475+
static inline void git_flockfile(FILE *fh UNUSED)
14751476
{
14761477
; /* nothing */
14771478
}
1478-
static inline void funlockfile(FILE *fh UNUSED)
1479+
static inline void git_funlockfile(FILE *fh UNUSED)
14791480
{
14801481
; /* nothing */
14811482
}
1483+
#define flockfile(fh) git_flockfile(fh)
1484+
#define funlockfile(fh) git_funlockfile(fh)
14821485
#define getc_unlocked(fh) getc(fh)
14831486
#endif
14841487

0 commit comments

Comments
 (0)