diff options
author | patthoyts <patthoyts@noemail.net> | 2006-10-01 21:51:33 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@noemail.net> | 2006-10-01 21:51:33 (GMT) |
commit | 6921f1c9b3e3d4157b00a555810357db01ad8e32 (patch) | |
tree | 9bc4b29527865ece18e559271ced174b9580c132 | |
parent | d3ee56df4158429facadb4da99478949f359e385 (diff) | |
download | tcl-6921f1c9b3e3d4157b00a555810357db01ad8e32.zip tcl-6921f1c9b3e3d4157b00a555810357db01ad8e32.tar.gz tcl-6921f1c9b3e3d4157b00a555810357db01ad8e32.tar.bz2 |
Handle possible missing define
FossilOrigin-Name: c8c5ac42cf588239508e635724dda08b95321ed9
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | win/tclWinFile.c | 11 |
2 files changed, 8 insertions, 4 deletions
@@ -1,5 +1,6 @@ 2006-10-01 Pat Thoyts <patthoyts@users.sourceforge.net> + * win/tclWinFile.c: Handle possible missing define. * win/tclWinFile.c: Backported fix for bug #1420432 (cannot set * tests/cmdAH.test: mtime for directories on windows). diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 7f1e12a..f0e07f2 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.16 2006/10/01 13:17:34 patthoyts Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.17 2006/10/01 21:51:34 patthoyts Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -82,6 +82,9 @@ # define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) # define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) #endif +#ifndef INVALID_FILE_ATTRIBUTES +#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) +#endif /* * Maximum reparse buffer info size. The max user defined reparse @@ -1851,7 +1854,7 @@ NativeStat(nativePath, statPtr, checkLinks) */ attr = (*tclWinProcs->getFileAttributesProc)(nativePath); - if (attr == 0xffffffff) { + if (attr == INVALID_FILE_ATTRIBUTES) { Tcl_SetErrno(ENOENT); return -1; } @@ -2355,7 +2358,7 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) * the current normalized path, if the file exists. */ if (isDrive) { - if (GetFileAttributesA(nativePath) == 0xffffffff) { + if (GetFileAttributesA(nativePath) == INVALID_FILE_ATTRIBUTES) { /* File doesn't exist */ if (isDrive) { int len = WinIsReserved(path); @@ -2385,7 +2388,7 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) handle = FindFirstFileA(nativePath, &fData); if (handle == INVALID_HANDLE_VALUE) { if (GetFileAttributesA(nativePath) - == 0xffffffff) { + == INVALID_FILE_ATTRIBUTES) { /* File doesn't exist */ Tcl_DStringFree(&ds); break; |