]> Savannah Git Hosting - gnulib.git/commitdiff
wchar: fix "conflicting types" error for __wcwidth on OS/2 kLIBC
authorKO Myung-Hun <komh78@gmail.com>
Thu, 14 Jan 2016 02:23:45 +0000 (11:23 +0900)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 15 Jan 2016 00:45:38 +0000 (16:45 -0800)
On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
static inline function.  The implementation of wcwidth in wcwidth.c
causes a "conflicting types" error.
* lib/wchar.in.h: Undefine wcwidth on OS/2 kLIBC.

lib/wchar.in.h

index 3ff9b6c01ccfadcef16d8855c77d44740a3c82c3..8e9fb89ccca45dd7ca2834326362e7fea521a944 100644 (file)
@@ -31,7 +31,7 @@
 @PRAGMA_COLUMNS@
 
 #if (((defined __need_mbstate_t || defined __need_wint_t)               \
-      && !defined __MINGW32__)                                          \
+      && !defined __MINGW32__ && !defined __KLIBC__)                    \
      || (defined __hpux                                                 \
          && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
@@ -445,6 +445,11 @@ _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 #  if !@HAVE_DECL_WCWIDTH@
 /* wcwidth exists but is not declared.  */
 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+#  elif defined __KLIBC__
+/* On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
+   static inline function.  The implementation of wcwidth in wcwidth.c
+   causes a "conflicting types" error. */
+#   undef wcwidth
 #  endif
 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
 # endif