brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · ff017c4 Raw
88 lines · c
1//===-- Platform.h ----------------------------------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_TOOLS_DRIVER_PLATFORM_H10#define LLDB_TOOLS_DRIVER_PLATFORM_H11 12#if defined(_WIN32)13 14#include <io.h>15#if defined(_MSC_VER)16#include <csignal>17#endif18 19#include "lldb/Host/windows/windows.h"20#include <cinttypes>21#include <sys/types.h>22 23struct winsize {24  long ws_col;25};26 27typedef unsigned char cc_t;28typedef unsigned int speed_t;29typedef unsigned int tcflag_t;30 31// fcntl.h32#define O_NOCTTY 040033 34// ioctls.h35#define TIOCGWINSZ 0x541336 37// signal.h38#define SIGPIPE 1339#define SIGCONT 1840#define SIGTSTP 2041#define SIGWINCH 2842 43// tcsetattr arguments44#define TCSANOW 045 46#define NCCS 3247struct termios {48  tcflag_t c_iflag; // input mode flags49  tcflag_t c_oflag; // output mode flags50  tcflag_t c_cflag; // control mode flags51  tcflag_t c_lflag; // local mode flags52  cc_t c_line;      // line discipline53  cc_t c_cc[NCCS];  // control characters54  speed_t c_ispeed; // input speed55  speed_t c_ospeed; // output speed56};57 58#ifdef _MSC_VER59struct timeval {60  long tv_sec;61  long tv_usec;62};63typedef long pid_t;64#define PATH_MAX MAX_PATH65#endif66 67#define STDIN_FILENO 068 69extern int ioctl(int d, int request, ...);70extern int kill(pid_t pid, int sig);71extern int tcsetattr(int fd, int optional_actions,72                     const struct termios *termios_p);73extern int tcgetattr(int fildes, struct termios *termios_p);74 75#else76#include <cinttypes>77 78#include <libgen.h>79#include <sys/ioctl.h>80#include <termios.h>81#include <unistd.h>82 83#include <pthread.h>84#include <sys/time.h>85#endif86 87#endif // LLDB_TOOLS_DRIVER_PLATFORM_H88