tech-userlevel archive

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

Re: typedef int wchar_t;



Alexander Nasonov wrote:
> I'm making wip/icc11 (Intel C++ compiler 11.1) package for NetBSD
> and I've run into a problem. The C++ compiler fails on > > typedef
> int wchar_t; > > line because wchar_t is C++ builtin type and it
> can't be redefined. On all other BSDs this line is guarded by
> #ifndef __cplusplus.

After changing 4 files in /usr/include (see the patch below) my
pkgsrc build runs smoothly. I was able to build all www/firefox
dependencies (with PKG_DEFAULT_OPTIONS=-fam).

Thanks,
Alex


Index: include/inttypes.h
===================================================================
RCS file: /cvsroot/src/include/inttypes.h,v
retrieving revision 1.6
diff -u -r1.6 inttypes.h
--- include/inttypes.h  4 Aug 2008 21:19:45 -0000       1.6
+++ include/inttypes.h  1 Nov 2009 12:05:15 -0000
@@ -36,7 +36,7 @@
 #include <sys/inttypes.h>
 #include <machine/ansi.h>
 
-#ifdef _BSD_WCHAR_T_
+#if defined(_BSD_WCHAR_T_) && !(defined(__ICC) && defined(__cplusplus))
 typedef        _BSD_WCHAR_T_   wchar_t;
 #undef _BSD_WCHAR_T_
 #endif
Index: include/stddef.h
===================================================================
RCS file: /cvsroot/src/include/stddef.h,v
retrieving revision 1.15
diff -u -r1.15 stddef.h
--- include/stddef.h    21 Aug 2006 16:58:29 -0000      1.15
+++ include/stddef.h    1 Nov 2009 12:05:15 -0000
@@ -45,7 +45,7 @@
 #undef _BSD_SIZE_T_
 #endif
 
-#ifdef _BSD_WCHAR_T_
+#if defined(_BSD_WCHAR_T_) && !(defined(__ICC) && defined(__cplusplus))
 typedef        _BSD_WCHAR_T_   wchar_t;
 #undef _BSD_WCHAR_T_
 #endif
Index: include/stdlib.h
===================================================================
RCS file: /cvsroot/src/include/stdlib.h,v
retrieving revision 1.89
diff -u -r1.89 stdlib.h
--- include/stdlib.h    20 Jul 2009 17:03:37 -0000      1.89
+++ include/stdlib.h    1 Nov 2009 12:05:15 -0000
@@ -48,7 +48,7 @@
 #undef _BSD_SIZE_T_
 #endif
 
-#ifdef _BSD_WCHAR_T_
+#if defined(_BSD_WCHAR_T_) && !(defined(__ICC) && defined(__cplusplus))
 typedef        _BSD_WCHAR_T_   wchar_t;
 #undef _BSD_WCHAR_T_
 #endif
Index: include/wchar.h
===================================================================
RCS file: /cvsroot/src/include/wchar.h,v
retrieving revision 1.27
diff -u -r1.27 wchar.h
--- include/wchar.h     28 Apr 2008 20:22:54 -0000      1.27
+++ include/wchar.h     1 Nov 2009 12:05:15 -0000
@@ -66,7 +66,7 @@
 
 #include <stdio.h> /* for FILE* */
 
-#ifdef _BSD_WCHAR_T_
+#if defined(_BSD_WCHAR_T_) && !(defined(__ICC) && defined(__cplusplus))
 typedef        _BSD_WCHAR_T_   wchar_t;
 #undef _BSD_WCHAR_T_
 #endif


Home | Main Index | Thread Index | Old Index