Constify. NFC.
[llvm-project.git] / lldb / tools / driver / Platform.h
blob521c5a1ccbb5153fa8a2692c23fcc0d79467e3e6
1 //===-- Platform.h ----------------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_Platform_h_
11 #define lldb_Platform_h_
13 #if defined(_WIN32)
15 #include "lldb/Host/HostGetOpt.h"
16 #include <io.h>
17 #if defined(_MSC_VER)
18 #include <signal.h>
19 #endif
20 #include "lldb/Host/windows/windows.h"
21 #include <inttypes.h>
23 struct winsize {
24 long ws_col;
27 typedef unsigned char cc_t;
28 typedef unsigned int speed_t;
29 typedef unsigned int tcflag_t;
31 // fcntl.h
32 #define O_NOCTTY 0400
34 // ioctls.h
35 #define TIOCGWINSZ 0x5413
37 // signal.h
38 #define SIGPIPE 13
39 #define SIGCONT 18
40 #define SIGTSTP 20
41 #define SIGWINCH 28
43 // tcsetattr arguments
44 #define TCSANOW 0
46 #define NCCS 32
47 struct termios {
48 tcflag_t c_iflag; // input mode flags
49 tcflag_t c_oflag; // output mode flags
50 tcflag_t c_cflag; // control mode flags
51 tcflag_t c_lflag; // local mode flags
52 cc_t c_line; // line discipline
53 cc_t c_cc[NCCS]; // control characters
54 speed_t c_ispeed; // input speed
55 speed_t c_ospeed; // output speed
58 #ifdef _MSC_VER
59 struct timeval {
60 long tv_sec;
61 long tv_usec;
63 typedef long pid_t;
64 #define snprintf _snprintf
65 #define PATH_MAX MAX_PATH
66 #endif
68 #define STDIN_FILENO 0
70 extern int ioctl(int d, int request, ...);
71 extern int kill(pid_t pid, int sig);
72 extern int tcsetattr(int fd, int optional_actions,
73 const struct termios *termios_p);
74 extern int tcgetattr(int fildes, struct termios *termios_p);
76 #else
77 #include "lldb/Host/HostGetOpt.h"
78 #include <inttypes.h>
80 #include <libgen.h>
81 #include <sys/ioctl.h>
82 #include <termios.h>
83 #include <unistd.h>
85 #include <pthread.h>
86 #include <sys/time.h>
87 #endif
89 #endif // lldb_Platform_h_