From 1251bcbcc6272da5c31c077c03ce238cfde19844 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 27 Mar 2012 14:26:16 +0000 Subject: se lower numbers, preventing integer overflow in tclWinError.c --- ChangeLog | 2 ++ win/tclWinPort.h | 42 +++++++++++++++++++++++++----------------- 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 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 -- cgit v0.12