{"thread":{"id":"30729","subject":"[PATCH] compat/fnmatch: Rename wchar functions to standard API","startedAt":"2012-06-06T13:08:16Z","lastAt":"2012-06-06T13:08:16Z","messageCount":1,"participants":["Vincent van Ravesteijn"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"192984","messageId":"1338988096-2136-1-git-send-email-vfr@lyx.org","threadId":"30729","inReplyTo":null,"subject":"[PATCH] compat/fnmatch: Rename wchar functions to standard API","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2012-06-06T13:08:16Z","receivedAt":"2012-06-06T13:08:16Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"On a platform that does not have glibc but does have 'wchar.h' or\n'wctype.h', the functions '__iswctype' and '__btowc' must be renamed to\nstandard API. If not, git cannot be compiled on the platform.\n\nThis code is taken from compat/regex/regex_internal.h.\n\nSigned-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n---\n compat/fnmatch/fnmatch.c |   16 ++++++++++++----\n 1 files changed, 12 insertions(+), 4 deletions(-)\n\ndiff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c\nindex 9473aed..3f9e3d6 100644\n--- a/compat/fnmatch/fnmatch.c\n+++ b/compat/fnmatch/fnmatch.c\n@@ -99,11 +99,19 @@\n #   define CHAR_CLASS_MAX_LENGTH 256\n #  endif\n \n-#  ifdef _LIBC\n-#   define IS_CHAR_CLASS(string) __wctype (string)\n-#  else\n-#   define IS_CHAR_CLASS(string) wctype (string)\n+/* Rename to standard API for using out of glibc.  */\n+#  ifndef _LIBC\n+#   ifdef __wctype\n+#    undef __wctype\n+#   endif\n+#   define __wctype wctype\n+#   ifdef __iswctype\n+#    undef __iswctype\n+#   endif\n+#   define __iswctype iswctype\n+#   define __btowc btowc\n #  endif\n+#  define IS_CHAR_CLASS(string) __wctype (string)\n # else\n #  define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */\n \n-- \n1.7.9.msysgit.0\n"}]}