]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/driver/Platform.h
Merge ^/head r319480 through r319547.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / 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 <signal.h>
19 #endif
20 #include "lldb/Host/windows/windows.h"
21 #include <inttypes.h>
22
23 struct winsize {
24   long ws_col;
25 };
26
27 typedef unsigned char cc_t;
28 typedef unsigned int speed_t;
29 typedef unsigned int tcflag_t;
30
31 // fcntl.h
32 #define O_NOCTTY 0400
33
34 // ioctls.h
35 #define TIOCGWINSZ 0x5413
36
37 // signal.h
38 #define SIGPIPE 13
39 #define SIGCONT 18
40 #define SIGTSTP 20
41 #define SIGWINCH 28
42
43 // tcsetattr arguments
44 #define TCSANOW 0
45
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
56 };
57
58 #ifdef _MSC_VER
59 struct timeval {
60   long tv_sec;
61   long tv_usec;
62 };
63 typedef long pid_t;
64 #define snprintf _snprintf
65 #define PATH_MAX MAX_PATH
66 #endif
67
68 #define STDIN_FILENO 0
69
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);
75
76 #else
77 #include "lldb/Host/HostGetOpt.h"
78 #include <inttypes.h>
79
80 #include <libgen.h>
81 #include <sys/ioctl.h>
82 #include <termios.h>
83 #include <unistd.h>
84
85 #include <pthread.h>
86 #include <sys/time.h>
87 #endif
88
89 #endif // lldb_Platform_h_