mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-16 03:44:56 +02:00
21 lines
336 B
C++
21 lines
336 B
C++
#if _WIN32
|
|
#include <io.h>
|
|
#else
|
|
#include <unistd.h>
|
|
#define _isatty isatty
|
|
#define _fileno fileno
|
|
#endif
|
|
#include "isatty.h"
|
|
|
|
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
|