[wpiutil] Rename WPI_kInvalidFile to WPI_INVALID_FILE

This commit is contained in:
Peter Johnson
2026-03-16 23:55:14 -07:00
parent 4059797635
commit c5e32652f9
3 changed files with 25 additions and 25 deletions

View File

@@ -27,10 +27,10 @@ using fstream = std::fstream;
#if defined(_WIN32)
// A Win32 HANDLE is a typedef of void*
using file_t = void*;
#define WPI_kInvalidFile reinterpret_cast<fs::file_t>(-1)
#define WPI_INVALID_FILE reinterpret_cast<fs::file_t>(-1)
#else
using file_t = int;
#define WPI_kInvalidFile -1
#define WPI_INVALID_FILE -1
#endif
enum CreationDisposition : unsigned {
@@ -138,7 +138,7 @@ file_t OpenFile(const path& Path, std::error_code& EC, CreationDisposition Disp,
* opened in, for example, read-write or in write-only mode.
* @param Mode The access permissions of the file, represented in octal.
* @returns a platform-specific file descriptor if \a Name has been opened,
* otherwise WPI_kInvalidFile.
* otherwise WPI_INVALID_FILE.
*/
inline file_t OpenFileForWrite(const path& Path, std::error_code& EC,
CreationDisposition Disp, OpenFlags Flags,
@@ -161,7 +161,7 @@ inline file_t OpenFileForWrite(const path& Path, std::error_code& EC,
* opened in, for example, read-write or in write-only mode.
* @param Mode The access permissions of the file, represented in octal.
* @return a platform-specific file descriptor if \a Name has been opened,
* otherwise WPI_kInvalidFile.
* otherwise WPI_INVALID_FILE.
*/
inline file_t OpenFileForReadWrite(const path& Path, std::error_code& EC,
CreationDisposition Disp, OpenFlags Flags,
@@ -180,7 +180,7 @@ inline file_t OpenFileForReadWrite(const path& Path, std::error_code& EC,
* @param EC Error code output, set to non-zero on error
* @param Flags Additional flags
* @return a platform-specific file descriptor if \a Name has been opened,
* otherwise WPI_kInvalidFile.
* otherwise WPI_INVALID_FILE.
*/
file_t OpenFileForRead(const path& Path, std::error_code& EC,
OpenFlags Flags = OF_None);
@@ -190,7 +190,7 @@ file_t OpenFileForRead(const path& Path, std::error_code& EC,
* must be closed with ::close() instead of CloseFile().
*
* @param F On input, this is the file to convert to a file descriptor.
* On output, the file is set to WPI_kInvalidFile.
* On output, the file is set to WPI_INVALID_FILE.
* @param EC Error code output, set to non-zero on error
* @param Flags Flags passed to the OpenFile function that created file_t
* @return file descriptor, or -1 on error
@@ -201,7 +201,7 @@ int FileToFd(file_t& F, std::error_code& EC, OpenFlags Flags);
* Closes the file object.
*
* @param F On input, this is the file to close. On output, the file is
* set to WPI_kInvalidFile.
* set to WPI_INVALID_FILE.
*/
void CloseFile(file_t& F);