]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Host/HostInfo.h
Merge ^/head r305220 through r305300.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Host / HostInfo.h
1 //===-- HostInfoBase.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_Host_HostInfo_h_
11 #define lldb_Host_HostInfo_h_
12
13 //----------------------------------------------------------------------
14 /// @class HostInfo HostInfo.h "lldb/Host/HostInfo.h"
15 /// @brief A class that provides host computer information.
16 ///
17 /// HostInfo is a class that answers information about the host operating
18 /// system.  Note that HostInfo is NOT intended to be used to manipulate or
19 /// control the operating system.
20 ///
21 /// HostInfo is implemented in an OS-specific class (for example
22 /// HostInfoWindows) in a separate file, and then typedefed to HostInfo here.
23 /// Users of the class reference it as HostInfo::method().
24 ///
25 /// Not all hosts provide the same functionality.  It is important that methods
26 /// only be implemented at the lowest level at which they make sense.  It should
27 /// be up to the clients of the class to ensure that they not attempt to call a
28 /// method which doesn't make sense for a particular platform.  For example,
29 /// when implementing a method that only makes sense on a posix-compliant
30 /// system, implement it on HostInfoPosix, and not on HostInfoBase with a
31 /// default implementation.  This way, users of HostInfo are required to think
32 /// about the implications of calling a particular method and if used in a
33 /// context where the method doesn't make sense, will generate a compiler error.
34 ///
35 //----------------------------------------------------------------------
36
37 #if defined(_WIN32)
38 #include "lldb/Host/windows/HostInfoWindows.h"
39 #define HOST_INFO_TYPE HostInfoWindows
40 #elif defined(__linux__)
41 #if defined(__ANDROID_NDK__)
42 #include "lldb/Host/android/HostInfoAndroid.h"
43 #define HOST_INFO_TYPE HostInfoAndroid
44 #else
45 #include "lldb/Host/linux/HostInfoLinux.h"
46 #define HOST_INFO_TYPE HostInfoLinux
47 #endif
48 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
49 #include "lldb/Host/freebsd/HostInfoFreeBSD.h"
50 #define HOST_INFO_TYPE HostInfoFreeBSD
51 #elif defined(__NetBSD__)
52 #include "lldb/Host/netbsd/HostInfoNetBSD.h"
53 #define HOST_INFO_TYPE HostInfoNetBSD
54 #elif defined(__APPLE__)
55 #include "lldb/Host/macosx/HostInfoMacOSX.h"
56 #define HOST_INFO_TYPE HostInfoMacOSX
57 #else
58 #include "lldb/Host/posix/HostInfoPosix.h"
59 #define HOST_INFO_TYPE HostInfoPosix
60 #endif
61
62 namespace lldb_private
63 {
64 typedef HOST_INFO_TYPE HostInfo;
65 }
66
67 #undef HOST_INFO_TYPE
68
69 #endif