From: Vincent van Ravesteijn <vfr@lyx.org>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Vincent van Ravesteijn <vfr@lyx.org>
Subject: [PATCH] compat/fnmatch: Rename wchar functions to standard API
Date: Wed, 6 Jun 2012 13:08:16 +0000 [thread overview]
Message-ID: <1338988096-2136-1-git-send-email-vfr@lyx.org> (raw)
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 <vfr@lyx.org>
---
compat/fnmatch/fnmatch.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c
index 9473aed..3f9e3d6 100644
--- a/compat/fnmatch/fnmatch.c
+++ b/compat/fnmatch/fnmatch.c
@@ -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'. */
--
1.7.9.msysgit.0
reply other threads:[~2012-06-06 13:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1338988096-2136-1-git-send-email-vfr@lyx.org \
--to=vfr@lyx.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).