tcl7.6的编译问题

Debian sarge 3.1,gcc3.3下编译tcl7.6出错

gcc -c -O -fPIC -I./../generic -I. -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DSTDC_HEADERS=1 -DNEED_MATHERR=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_SHLIB_EXT=".so" ./../generic/tclPosixStr.c
./../generic/tclPosixStr.c: In function `Tcl_ErrnoId':
./../generic/tclPosixStr.c:340: error: duplicate case value
./../generic/tclPosixStr.c:328: error: previously used here
./../generic/tclPosixStr.c: In function `Tcl_ErrnoMsg':
./../generic/tclPosixStr.c:787: error: duplicate case value
./../generic/tclPosixStr.c:775: error: previously used here
make: *** [tclPosixStr.o] Error 1

patch file

--- tclPosixStr.c 1996-10-11 04:58:40.000000000 +0800
+++ tclPosixStr.new.c 2006-07-02 17:22:39.000000000 +0800
@@ -336,7 +336,7 @@
#ifdef ENXIO
case ENXIO: return "ENXIO";
#endif
-#ifdef EOPNOTSUPP
+#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
case EOPNOTSUPP: return "EOPNOTSUPP";
#endif
#ifdef EPERM
@@ -783,7 +783,7 @@
#ifdef ENXIO
case ENXIO: return "no such device or address";
#endif
-#ifdef EOPNOTSUPP
+#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
case EOPNOTSUPP: return "operation not supported on socket";
#endif
#ifdef EPERM


相关文章

Speak Your Mind

If you want a pic to show with your comment, go get a gravatar!