Skip to content

Commit ca29623

Browse files
committed
use _isatty on Windows
isatty is considered deprecated by MSVC. Signed-off-by: Rosen Penev <[email protected]>
1 parent a8e65f4 commit ca29623

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/basicio.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ namespace fs = std::filesystem;
4545

4646
#ifndef _WIN32
4747
#define _fileno fileno
48+
#define _isatty isatty
4849
#endif
4950

5051
namespace Exiv2 {
@@ -921,7 +922,7 @@ std::string XPathIo::writeDataToFile(const std::string& orgPath) {
921922
auto path = stringFormat("{}{}", timestamp, XPathIo::TEMP_FILE_EXT);
922923

923924
if (prot == pStdin) {
924-
if (isatty(_fileno(stdin)))
925+
if (_isatty(_fileno(stdin)))
925926
throw Error(ErrorCode::kerInputDataReadFailed);
926927
#ifdef _WIN32
927928
// convert stdin to binary

0 commit comments

Comments
 (0)