1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-08 12:26:13 +02:00

Merge branch 'jc/noop-with-static-inline'

A no-op replacement function implemented as a C preprocessor macro
does not perform as good a job as one implemented as a "static
inline" function in catching errors in parameters; replace the
former with the latter in <git-compat-util.h> header.

* jc/noop-with-static-inline:
  compat-util: type-check parameters of no-op replacement functions
This commit is contained in:
Junio C Hamano 2020-08-17 17:02:44 -07:00
commit a01dadb9a9

View File

@ -252,8 +252,10 @@ typedef unsigned long uintptr_t;
#ifdef PRECOMPOSE_UNICODE
#include "compat/precompose_utf8.h"
#else
#define precompose_str(in,i_nfd2nfc)
#define precompose_argv(c,v)
static inline void precompose_argv(int argc, const char **argv)
{
; /* nothing */
}
#define probe_utf8_pathname_composition()
#endif
@ -270,7 +272,9 @@ struct itimerval {
#endif
#ifdef NO_SETITIMER
#define setitimer(which,value,ovalue)
static inline int setitimer(int which, const struct itimerval *value, struct itimerval *newvalue) {
; /* nothing */
}
#endif
#ifndef NO_LIBGEN_H
@ -1231,8 +1235,14 @@ int warn_on_fopen_errors(const char *path);
#endif
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
#define flockfile(fh)
#define funlockfile(fh)
static inline void flockfile(FILE *fh)
{
; /* nothing */
}
static inline void funlockfile(FILE *fh)
{
; /* nothing */
}
#define getc_unlocked(fh) getc(fh)
#endif