summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-27 14:26:16 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-27 14:26:16 (GMT)
commit1251bcbcc6272da5c31c077c03ce238cfde19844 (patch)
treeadc528ffaf4258cd734aa3d49c7e78f6d4e19a24
parent346f5718f86090683709671a6028aa962edf6e54 (diff)
downloadtcl-1251bcbcc6272da5c31c077c03ce238cfde19844.zip
tcl-1251bcbcc6272da5c31c077c03ce238cfde19844.tar.gz
tcl-1251bcbcc6272da5c31c077c03ce238cfde19844.tar.bz2
se lower numbers, preventing integer overflow in tclWinError.c
-rw-r--r--ChangeLog2
-rw-r--r--win/tclWinPort.h42
2 files changed, 27 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 8dd5e8f..5c25427 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@
* generic/tclFCmd.c: [Bug 2015723]: Duplicate inodes from file stat
* generic/tclCmdAH.c: on windows (but now for cygwin as well).
* generic/tclOODefineCmds.c: minor gcc warning
+ * win/tclWinPort.h: Use lower numbers, preventing integer overflow.
+ (and remove the workaround for mingw-w64 bug 3407992. It's long fixed)
2012-03-27 Donal K. Fellows <dkf@users.sf.net>
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index e3c5a49..db46a4a 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -226,9 +226,9 @@ typedef DWORD_PTR * PDWORD_PTR;
#ifndef EOTHER
# define EOTHER 131 /* Other error */
#endif
-/* workaround for mingw-w64 bug 3407992 */
-#undef EOVERFLOW
-#define EOVERFLOW 132 /* File too big */
+#ifndef EOVERFLOW
+# define EOVERFLOW 132 /* File too big */
+#endif
#ifndef EOWNERDEAD
# define EOWNERDEAD 133 /* Owner dead */
#endif
@@ -255,20 +255,28 @@ typedef DWORD_PTR * PDWORD_PTR;
#endif
-#undef ESOCKTNOSUPPORT
-#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT /* Socket type not supported */
-#undef ESHUTDOWN
-#define ESHUTDOWN WSAESHUTDOWN /* Can't send after socket shutdown */
-#undef ETOOMANYREFS
-#define ETOOMANYREFS WSAETOOMANYREFS /* Too many references: can't splice */
-#undef EHOSTDOWN
-#define EHOSTDOWN WSAEHOSTDOWN /* Host is down */
-#undef EUSERS
-#define EUSERS WSAEUSERS /* Too many users (for UFS) */
-#undef EDQUOT
-#define EDQUOT WSAEDQUOT /* Disc quota exceeded */
-#undef ESTALE
-#define ESTALE WSAESTALE /* Stale NFS file handle */
+/* Visual Studio doesn't have these, so just choose some high numbers */
+#ifndef ESOCKTNOSUPPORT
+# define ESOCKTNOSUPPORT 240 /* Socket type not supported */
+#endif
+#ifndef ESHUTDOWN
+# define ESHUTDOWN 241 /* Can't send after socket shutdown */
+#endif
+#ifndef ETOOMANYREFS
+# define ETOOMANYREFS 242 /* Too many references: can't splice */
+#endif
+#ifndef EHOSTDOWN
+# define EHOSTDOWN 243 /* Host is down */
+#endif
+#ifndef EUSERS
+# define EUSERS 244 /* Too many users (for UFS) */
+#endif
+#ifndef EDQUOT
+# define EDQUOT 245 /* Disc quota exceeded */
+#endif
+#ifndef ESTALE
+# define ESTALE 246 /* Stale NFS file handle */
+#endif
/*
* Signals not known to the standard ANSI signal.h. These are used