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