octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wctype.h problem for MinGW build


From: John W. Eaton
Subject: wctype.h problem for MinGW build
Date: Wed, 6 Jan 2010 02:30:17 -0500

On  6-Jan-2010, Tatsuro MATSUOKA wrote:

| After addition of '-I../libgnu'  to the Makefile (include -I../libgnu in 
AM_CPPFLAGS  changeset),  
| I have met wctype.h problem.
| 
| 
| 
| /bin/sh ../libtool  --tag=CXX   --mode=compile g++ -shared-libgcc 
-DHAVE_CONFIG_H -I.
| -I../../../hg/octave-work/liboctave -I..-Ic:/Programs/OctaveBuild/include
| -Ic:/Programs/WinDevTools/include -Ic:/Programs/GnuWin32/include 
-IC:/Programs/GnuWin32/include
| -I../libgnu -I../../../hg/octave-work/libgnu 
-I../../../hg/octave-work/libcruft/misc
| -Ic:/Programs/OctaveBuild/include -Ic:/Programs/WinDevTools/include 
-Ic:/Programs/GnuWin32/include
| -IC:/Programs/GnuWin32/include -O3 -fomit-frame-pointer  -DHAVE_CONFIG_H 
-mieee-fp
| -I/WinDevTools/bin/../include/freetype2 -I/WinDevTools/bin/../include
| -IC:/Programs/WinDevTools/include   -Wall -W -Wshadow -Wold-style-cast 
-Wformat -O3
| -fomit-frame-pointer  -O3 -fomit-frame-pointer -MT liboctave_la-CollocWt.lo 
-MD -MP -MF
| .deps/liboctave_la-CollocWt.Tpo -c -o liboctave_la-CollocWt.lo `test -f 
'CollocWt.cc' || echo
| '../../../hg/octave-work/liboctave/'`CollocWt.cc
| 
| libtool: compile:  g++ -shared-libgcc -DHAVE_CONFIG_H -I. 
-I../../../hg/octave-work/liboctave -I..
| -Ic:/Programs/OctaveBuild/include -Ic:/Programs/WinDevTools/include 
-Ic:/Programs/GnuWin32/include
| -IC:/Programs/GnuWin32/include -I../libgnu -I../../../hg/octave-work/libgnu
| -I../../../hg/octave-work/libcruft/misc -Ic:/Programs/OctaveBuild/include
| -Ic:/Programs/WinDevTools/include -Ic:/Programs/GnuWin32/include 
-IC:/Programs/GnuWin32/include -O3
| -fomit-frame-pointer -DHAVE_CONFIG_H -mieee-fp 
-I/WinDevTools/bin/../include/freetype2
| -I/WinDevTools/bin/../include -IC:/Programs/WinDevTools/include -Wall -W 
-Wshadow -Wold-style-cast
| -Wformat -O3 -fomit-frame-pointer -O3 -fomit-frame-pointer -MT 
liboctave_la-CollocWt.lo -MD -MP -MF
| .deps/liboctave_la-CollocWt.Tpo -c 
../../../hg/octave-work/liboctave/CollocWt.cc  -DDLL_EXPORT -DPIC
| -o .libs/liboctave_la-CollocWt.o
| 
| In file included from 
c:\programs\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cctype:44,
|                  from 
c:\programs\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/localefwd.h:44,
|                  from 
c:\programs\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/ios:42,
|                  from 
c:\programs\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/ostream:40,
|                  from 
c:\programs\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/iostream:40,
|                  from ../../../hg/octave-work/liboctave/CollocWt.cc:28:
| ../libgnu/wctype.h:218: error: previous declaration of 'wint_t 
rpl_towlower(wint_t)' with 'C++'
| linkage
| 
c:\programs\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/ctype.h:215: 
error: conflicts with
| new declaration with 'C' linkage
| ../libgnu/wctype.h:225: error: previous declaration of 'wint_t 
rpl_towupper(wint_t)' with 'C++'
| linkage
| 
c:\programs\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/ctype.h:216: 
error: conflicts with
| new declaration with 'C' linkage
| 
| wctype.h 217-228 *************
| static inline wint_t
| rpl_towlower (wint_t wc)
| {
|   return (wint_t) (wchar_t) towlower (wc);
| }
| #  define towlower rpl_towlower
| 
| static inline wint_t
| rpl_towupper (wint_t wc)
| {
|   return (wint_t) (wchar_t) towupper (wc);
| }
| #  define towupper rpl_towupper
| 
| *****************
| 
| *******************
| /include/ctype.h(MinGW header file) 215-216
| _CRTIMP wint_t __cdecl __MINGW_NOTHROW towlower (wint_t);
| _CRTIMP wint_t __cdecl __MINGW_NOTHROW towupper (wint_t);
| 
| 
| I have tried the following modification but the error was the same as before 
modification,
| 
| --- wctype.h.orig     2010-01-06 12:50:10 +0900
| +++ wctype.h  2010-01-06 13:40:30 +0900
| @@ -219,6 +219,7 @@
|  {
|    return (wint_t) (wchar_t) towlower (wc);
|  }
| +#  undef towlower
|  #  define towlower rpl_towlower
|  
|  static inline wint_t
| @@ -226,6 +227,7 @@
|  {
|    return (wint_t) (wchar_t) towupper (wc);
|  }
| +#  undef towlower
|  #  define towupper rpl_towupper
|  
|  # endif
| 
| 
| ***********************
| 
| Any suggestions?

I think the declarations in the gnulib/lib/wctype.in.h need to be
inside an extern "C" block.  Does the following patch help?  If so,
I'll report the problem to the gnulib maintainers.

jwe

diff --git a/lib/wctype.in.h b/lib/wctype.in.h
index 01a0779..56f3daf 100644
--- a/lib/wctype.in.h
+++ b/lib/wctype.in.h
@@ -105,6 +105,10 @@
 #   define towupper rpl_towupper
 #  endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 static inline int
 iswalnum (wint_t wc)
 {
@@ -227,5 +231,9 @@ rpl_towupper (wint_t wc)
 
 # endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_WCTYPE_H */
 #endif /* _GL_WCTYPE_H */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]