/
redgpu
/
raygpu
Обзор
Документация
Войти
/
redgpu
/
raygpu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.1
src/windows_stuff.c
23 строки
622 B
FIRST_NAME LAST_NAME
ffmpeg output
06 янв 2025, 13:36
06 янв 2025, 13:36
9233aad
Код
Авторство
О чём код?
#include <stdbool.h> #include <stdio.h> #if defined(_WIN32) || defined(_WIN64) #include <io.h> // For _isatty and _fileno #define PORTABLE_ISATTY _isatty #define PORTABLE_FILENO _fileno #else #include <unistd.h> // For isatty and fileno #define PORTABLE_ISATTY isatty #define PORTABLE_FILENO fileno #endif /** * @brief Portable function to check if a file descriptor refers to a terminal. * * @param fd The file descriptor to check. * @return int Returns 1 if `fd` is a terminal, 0 otherwise. */ bool IsATerminal(FILE *stream) { return PORTABLE_ISATTY(PORTABLE_FILENO(stream)); }