1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-16 03:44:56 +02:00
antelope-keygen/cli/isatty.cpp

21 lines
338 B
C++

#if _WIN32
#include <io.h>
#else
#include <unistd.h>
#define _isatty isatty
#define _fileno fileno
#endif
#include "isatty.hpp"
namespace eoskeygen {
bool isatty(int fd) {
return ::_isatty(fd);
}
bool isatty(FILE* fd) {
// fileno() segfaults if fd is null.
return fd ? isatty(_fileno(fd)) : false;
}
} // namespace eoskeygen