Re: [PATCH] git-compat-util: Avoid strcasecmp() being inlined
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 11, 2013, 18:39 UTC
- Message-ID
- <xmqqzjrjryms.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <523094F0.9000509@gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
> This is necessary so that read_mailmap() can obtain a pointer to the > function.
Whoa, I didn't think it is even legal for a C library to supply strcmp() or strcasecmp() that are purely inline you cannot take the address of. The "solution" looks a bit too large a hammer that affects everybody, not just those who have such a set of header files.
Show 22 quoted lines
> > +#define __NO_INLINE__ /* do not inline strcasecmp() */ > +#include <string.h> > +#ifdef HAVE_STRINGS_H > +#include <strings.h> /* for strcasecmp() */ > +#endif > +#undef __NO_INLINE__ > + > #ifdef WIN32 /* Both MinGW and MSVC */ > #define _WIN32_WINNT 0x0502 > #define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */ > @@ -99,10 +106,6 @@ > #include <stddef.h> > #include <stdlib.h> > #include <stdarg.h> > -#include <string.h> > -#ifdef HAVE_STRINGS_H > -#include <strings.h> /* for strcasecmp() */ > -#endif > #include <errno.h> > #include <limits.h> > #ifdef NEEDS_SYS_PARAM_H