compat/fnmatch: Rename wchar functions to standard API
PATCH 1/1 compat/fnmatch: Rename wchar functions to standard API
On a platform that does not have glibc but does have 'wchar.h' or 'wctype.h', the functions '__iswctype' and '__btowc' must be renamed to standard API. If not, git cannot be compiled on the platform.
This code is taken from compat/regex/regex_internal.h.
Signed-off-by Vincent van Ravesteijn <[email protected]>
--- compat/fnmatch/fnmatch.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-)
compat/fnmatch/fnmatch.c +12 -4
@@ -99,11 +99,19 @@# define CHAR_CLASS_MAX_LENGTH 256# endif -# ifdef _LIBC -# define IS_CHAR_CLASS (string) __wctype (string) -# else -# define IS_CHAR_CLASS (string) wctype (string) +/* Rename to standard API for using out of glibc. */ +# ifndef _LIBC +# ifdef __wctype +# undef __wctype +# endif +# define __wctype wctype +# ifdef __iswctype +# undef __iswctype +# endif +# define __iswctype iswctype +# define __btowc btowc# endif +# define IS_CHAR_CLASS (string) __wctype (string)# else # define CHAR_CLASS_MAX_LENGTH 6/* Namely, `xdigit'. */
Signature · 1 line
1.7.9.msysgit.0