]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/driver/Platform.h
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / tools / driver / Platform.h
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 //===----------------------------------------------------------------------===//
9
10 #ifndef lldb_Platform_h_
11 #define lldb_Platform_h_
12
13 #if defined(_WIN32)
14
15 #include "lldb/Host/HostGetOpt.h"
16 #include <io.h>
17 #if defined(_MSC_VER)
18 #include <eh.h>
19 #include <signal.h>
20 #endif
21 #include "lldb/Host/windows/windows.h"
22 #include <inttypes.h>
23
24 struct winsize {
25   long ws_col;
26 };
27
28 typedef unsigned char cc_t;
29 typedef unsigned int speed_t;
30 typedef unsigned int tcflag_t;
31
32 // fcntl.h
33 #define O_NOCTTY 0400
34
35 // ioctls.h
36 #define TIOCGWINSZ 0x5413
37
38 // signal.h
39 #define SIGPIPE 13
40 #define SIGCONT 18
41 #define SIGTSTP 20
42 #define SIGWINCH 28
43
44 // tcsetattr arguments
45 #define TCSANOW 0
46
47 #define NCCS 32
48 struct termios {
49   tcflag_t c_iflag; // input mode flags
50   tcflag_t c_oflag; // output mode flags
51   tcflag_t c_cflag; // control mode flags
52   tcflag_t c_lflag; // local mode flags
53   cc_t c_line;      // line discipline
54   cc_t c_cc[NCCS];  // control characters
55   speed_t c_ispeed; // input speed
56   speed_t c_ospeed; // output speed
57 };
58
59 #ifdef _MSC_VER
60 struct timeval {
61   long tv_sec;
62   long tv_usec;
63 };
64 typedef long pid_t;
65 #define snprintf _snprintf
66 #define PATH_MAX MAX_PATH
67 #endif
68
69 #define STDIN_FILENO 0
70
71 extern int ioctl(int d, int request, ...);
72 extern int kill(pid_t pid, int sig);
73 extern int tcsetattr(int fd, int optional_actions,
74                      const struct termios *termios_p);
75 extern int tcgetattr(int fildes, struct termios *termios_p);
76
77 #else
78 #include "lldb/Host/HostGetOpt.h"
79 #include <inttypes.h>
80
81 #include <libgen.h>
82 #include <sys/ioctl.h>
83 #include <termios.h>
84 #include <unistd.h>
85
86 #include <pthread.h>
87 #include <sys/time.h>
88 #endif
89
90 #endif // lldb_Platform_h_