|
|
|||
File indexing completed on 2026-05-10 08:42:49
0001 //===-- HostInfo.h ----------------------------------------------*- C++ -*-===// 0002 // 0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 0004 // See https://llvm.org/LICENSE.txt for license information. 0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 0006 // 0007 //===----------------------------------------------------------------------===// 0008 0009 #ifndef LLDB_HOST_HOSTINFO_H 0010 #define LLDB_HOST_HOSTINFO_H 0011 0012 /// \class HostInfo HostInfo.h "lldb/Host/HostInfo.h" 0013 /// A class that provides host computer information. 0014 /// 0015 /// HostInfo is a class that answers information about the host operating 0016 /// system. Note that HostInfo is NOT intended to be used to manipulate or 0017 /// control the operating system. 0018 /// 0019 /// HostInfo is implemented in an OS-specific class (for example 0020 /// HostInfoWindows) in a separate file, and then typedefed to HostInfo here. 0021 /// Users of the class reference it as HostInfo::method(). 0022 /// 0023 /// Not all hosts provide the same functionality. It is important that 0024 /// methods only be implemented at the lowest level at which they make sense. 0025 /// It should be up to the clients of the class to ensure that they not 0026 /// attempt to call a method which doesn't make sense for a particular 0027 /// platform. For example, when implementing a method that only makes sense 0028 /// on a posix-compliant system, implement it on HostInfoPosix, and not on 0029 /// HostInfoBase with a default implementation. This way, users of HostInfo 0030 /// are required to think about the implications of calling a particular 0031 /// method and if used in a context where the method doesn't make sense, will 0032 /// generate a compiler error. 0033 /// 0034 0035 #if defined(_WIN32) 0036 #include "lldb/Host/windows/HostInfoWindows.h" 0037 #define HOST_INFO_TYPE HostInfoWindows 0038 #elif defined(__linux__) || defined(__EMSCRIPTEN__) 0039 #if defined(__ANDROID__) 0040 #include "lldb/Host/android/HostInfoAndroid.h" 0041 #define HOST_INFO_TYPE HostInfoAndroid 0042 #else 0043 #include "lldb/Host/linux/HostInfoLinux.h" 0044 #define HOST_INFO_TYPE HostInfoLinux 0045 #endif 0046 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 0047 #include "lldb/Host/freebsd/HostInfoFreeBSD.h" 0048 #define HOST_INFO_TYPE HostInfoFreeBSD 0049 #elif defined(__NetBSD__) 0050 #include "lldb/Host/netbsd/HostInfoNetBSD.h" 0051 #define HOST_INFO_TYPE HostInfoNetBSD 0052 #elif defined(__OpenBSD__) 0053 #include "lldb/Host/openbsd/HostInfoOpenBSD.h" 0054 #define HOST_INFO_TYPE HostInfoOpenBSD 0055 #elif defined(__APPLE__) 0056 #include "lldb/Host/macosx/HostInfoMacOSX.h" 0057 #define HOST_INFO_TYPE HostInfoMacOSX 0058 #elif defined(_AIX) 0059 #include "lldb/Host/aix/HostInfoAIX.h" 0060 #define HOST_INFO_TYPE HostInfoAIX 0061 #else 0062 #include "lldb/Host/posix/HostInfoPosix.h" 0063 #define HOST_INFO_TYPE HostInfoPosix 0064 #endif 0065 0066 namespace lldb_private { 0067 typedef HOST_INFO_TYPE HostInfo; 0068 } 0069 0070 #undef HOST_INFO_TYPE 0071 0072 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|