From 0c25b2705cdac01590054d0027ef57e71169004e Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sun, 1 Oct 2006 21:51:33 +0000 Subject: Handle possible missing define --- ChangeLog | 1 + win/tclWinFile.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6911e60..56ec2f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2006-10-01 Pat Thoyts + * 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; -- cgit v0.12