[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extern "C" for wctype.h?
From: |
Bruno Haible |
Subject: |
Re: extern "C" for wctype.h? |
Date: |
Thu, 7 Jan 2010 23:57:09 +0100 |
User-agent: |
KMail/1.9.9 |
Hi,
John W. Eaton wrote:
> Adding an extern "C" block around the function declarations in
> ctype.in.h as in the attached patch solved the problem.
Thanks. The patch is all right. But it uncovers that wctype.in.h is badly
indented. Fixes as follows:
2010-01-07 Bruno Haible <address@hidden>
Fix indentation of wctype.in.h, broken since 2007-01-06.
* lib/wctype.in.h: Fix indentation of preprocessor directives.
--- lib/wctype.in.h.orig Thu Jan 7 23:54:16 2010
+++ lib/wctype.in.h Thu Jan 7 23:53:40 2010
@@ -76,38 +76,38 @@
refer to system functions like _iswctype that are not in the
standard C library. Rather than try to get ancient buggy
implementations like this to work, just disable them. */
-# undef iswalnum
-# undef iswalpha
-# undef iswblank
-# undef iswcntrl
-# undef iswdigit
-# undef iswgraph
-# undef iswlower
-# undef iswprint
-# undef iswpunct
-# undef iswspace
-# undef iswupper
-# undef iswxdigit
-# undef towlower
-# undef towupper
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# undef iswspace
+# undef iswupper
+# undef iswxdigit
+# undef towlower
+# undef towupper
/* Linux libc5 has <wctype.h> and the functions but they are broken. */
-# if @REPLACE_ISWCNTRL@
-# define iswalnum rpl_iswalnum
-# define iswalpha rpl_iswalpha
-# define iswblank rpl_iswblank
-# define iswcntrl rpl_iswcntrl
-# define iswdigit rpl_iswdigit
-# define iswgraph rpl_iswgraph
-# define iswlower rpl_iswlower
-# define iswprint rpl_iswprint
-# define iswpunct rpl_iswpunct
-# define iswspace rpl_iswspace
-# define iswupper rpl_iswupper
-# define iswxdigit rpl_iswxdigit
-# define towlower rpl_towlower
-# define towupper rpl_towupper
-# endif
+# if @REPLACE_ISWCNTRL@
+# define iswalnum rpl_iswalnum
+# define iswalpha rpl_iswalpha
+# define iswblank rpl_iswblank
+# define iswcntrl rpl_iswcntrl
+# define iswdigit rpl_iswdigit
+# define iswgraph rpl_iswgraph
+# define iswlower rpl_iswlower
+# define iswprint rpl_iswprint
+# define iswpunct rpl_iswpunct
+# define iswspace rpl_iswspace
+# define iswupper rpl_iswupper
+# define iswxdigit rpl_iswxdigit
+# define towlower rpl_towlower
+# define towupper rpl_towupper
+# endif
static inline int
iswalnum (wint_t wc)
@@ -198,9 +198,9 @@
return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
}
-# endif /* ! HAVE_ISWCNTRL */
+#endif /* ! HAVE_ISWCNTRL || REPLACE_ISWCNTRL */
-# if defined __MINGW32__
+#if defined __MINGW32__
/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
The functions towlower and towupper are implemented in the MSVCRT library
@@ -220,16 +220,16 @@
{
return (wint_t) (wchar_t) towlower (wc);
}
-# define towlower rpl_towlower
+# define towlower rpl_towlower
static inline wint_t
rpl_towupper (wint_t wc)
{
return (wint_t) (wchar_t) towupper (wc);
}
-# define towupper rpl_towupper
+# define towupper rpl_towupper
-# endif
+#endif /* __MINGW32__ */
#ifdef __cplusplus
}