]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/avoid-redef-system-functions-2.30' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 1 Dec 2022 00:14:46 +0000 (09:14 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Dec 2022 00:14:46 +0000 (09:14 +0900)
* jk/avoid-redef-system-functions-2.30:
  git-compat-util: avoid redefining system function names

git-compat-util.h

index 045b47f83adef894583823786be4b5e707c05806..32ed03768b5b2d5c9228fca48c9ac7400bdf8324 100644 (file)
@@ -338,9 +338,12 @@ struct itimerval {
 #endif
 
 #ifdef NO_SETITIMER
-static inline int setitimer(int which, const struct itimerval *value, struct itimerval *newvalue) {
+static inline int git_setitimer(int which,
+                               const struct itimerval *value,
+                               struct itimerval *newvalue) {
        return 0; /* pretend success */
 }
+#define setitimer(which,value,ovalue) git_setitimer(which,value,ovalue)
 #endif
 
 #ifndef NO_LIBGEN_H
@@ -1466,14 +1469,16 @@ int open_nofollow(const char *path, int flags);
 #endif
 
 #ifndef _POSIX_THREAD_SAFE_FUNCTIONS
-static inline void flockfile(FILE *fh)
+static inline void git_flockfile(FILE *fh)
 {
        ; /* nothing */
 }
-static inline void funlockfile(FILE *fh)
+static inline void git_funlockfile(FILE *fh)
 {
        ; /* nothing */
 }
+#define flockfile(fh) git_flockfile(fh)
+#define funlockfile(fh) git_funlockfile(fh)
 #define getc_unlocked(fh) getc(fh)
 #endif