Skip to content

Commit 5ea17ad

Browse files
committed
git-compat-util: Avoid strcasecmp() being inlined
This is necessary so that read_mailmap() can obtain a pointer to the function. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 841cdf6 commit 5ea17ad

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

git-compat-util.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@
8585
#define _NETBSD_SOURCE 1
8686
#define _SGI_SOURCE 1
8787

88+
#ifdef __MINGW32__
89+
#ifdef __NO_INLINE__
90+
#define __NO_INLINE_ALREADY_DEFINED
91+
#else
92+
#define __NO_INLINE__ /* do not inline strcasecmp() */
93+
#endif
94+
#endif
95+
#include <string.h>
96+
#ifdef __MINGW32__
97+
#ifdef __NO_INLINE_ALREADY_DEFINED
98+
#undef __NO_INLINE_ALREADY_DEFINED
99+
#else
100+
#undef __NO_INLINE__
101+
#endif
102+
#endif
103+
#ifdef HAVE_STRINGS_H
104+
#include <strings.h> /* for strcasecmp() */
105+
#endif
106+
88107
#ifdef WIN32 /* Both MinGW and MSVC */
89108
#define _WIN32_WINNT 0x0502
90109
#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
@@ -99,10 +118,6 @@
99118
#include <stddef.h>
100119
#include <stdlib.h>
101120
#include <stdarg.h>
102-
#include <string.h>
103-
#ifdef HAVE_STRINGS_H
104-
#include <strings.h> /* for strcasecmp() */
105-
#endif
106121
#include <errno.h>
107122
#include <limits.h>
108123
#ifdef NEEDS_SYS_PARAM_H

0 commit comments

Comments
 (0)