]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/driver/Platform.h
Merge ^/head r275759 through r275911.
[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 #include "lldb/Host/HostGetOpt.h"
14
15 #if defined( _WIN32 )
16
17     // this will stop signal.h being included
18     #define _INC_SIGNAL
19     #include <io.h>
20 #if defined( _MSC_VER )
21     #include <eh.h>
22 #endif
23     #include <inttypes.h>
24     #include "lldb/Host/windows/windows.h"
25
26     struct winsize
27     {
28         long ws_col;
29     };
30
31     typedef unsigned char   cc_t;
32     typedef unsigned int    speed_t;
33     typedef unsigned int    tcflag_t;
34
35     // fcntl.h
36     #define O_NOCTTY 0400
37
38     // ioctls.h
39     #define TIOCGWINSZ 0x5413
40
41
42     // signal handler function pointer type
43     typedef void(*sighandler_t)(int);
44
45     // signal.h
46     #define SIGINT 2
47     // default handler
48     #define SIG_DFL ( (sighandler_t) -1 )
49     // ignored
50     #define SIG_IGN ( (sighandler_t) -2 )
51
52     // signal.h
53     #define SIGPIPE  13
54     #define SIGCONT  18
55     #define SIGTSTP  20
56     #define SIGWINCH 28
57
58     // tcsetattr arguments
59     #define TCSANOW 0
60
61     #define NCCS 32
62     struct termios
63     {
64         tcflag_t c_iflag;  // input mode flags
65         tcflag_t c_oflag;  // output mode flags
66         tcflag_t c_cflag;  // control mode flags
67         tcflag_t c_lflag;  // local mode flags
68         cc_t c_line;       // line discipline
69         cc_t c_cc[NCCS];   // control characters
70         speed_t c_ispeed;  // input speed
71         speed_t c_ospeed;  // output speed
72     };
73
74
75
76 #ifdef _MSC_VER
77     struct timeval
78     {
79         long tv_sec;
80         long tv_usec;
81     };
82     typedef long pid_t;
83     #define snprintf _snprintf
84     extern sighandler_t signal( int sig, sighandler_t );
85     #define PATH_MAX MAX_PATH
86 #endif
87
88     #define STDIN_FILENO 0
89
90     extern int  ioctl( int d, int request, ... );
91     extern int  kill ( pid_t pid, int sig      );
92     extern int  tcsetattr( int fd, int optional_actions, const struct termios *termios_p );
93     extern int  tcgetattr( int fildes, struct termios *termios_p );
94
95 #else
96
97     #include <inttypes.h>
98
99     #include <libgen.h>
100     #include <sys/ioctl.h>
101     #include <termios.h>
102     #include <unistd.h>
103
104     #include <histedit.h>
105     #include <pthread.h>
106     #include <sys/time.h>
107
108 #endif
109
110 #endif // lldb_Platform_h_