git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] compat/fnmatch: Rename wchar functions to standard API
@ 2012-06-06 13:08 Vincent van Ravesteijn
  0 siblings, 0 replies; only message in thread
From: Vincent van Ravesteijn @ 2012-06-06 13:08 UTC (permalink / raw)
  To: git; +Cc: gitster, Vincent van Ravesteijn

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-06 13:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 13:08 [PATCH] compat/fnmatch: Rename wchar functions to standard API Vincent van Ravesteijn

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).