rename methods in System/Host to be more consistent.
[oota-llvm.git] / include / llvm / System / Host.h
1 //===- llvm/System/Host.h - Host machine characteristics --------*- 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 // Methods for querying the nature of the host machine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_SYSTEM_HOST_H
15 #define LLVM_SYSTEM_HOST_H
16
17 #include <string>
18
19 namespace llvm {
20 namespace sys {
21
22   inline bool isLittleEndianHost() {
23     union {
24       int i;
25       char c;
26     };
27     i = 1;
28     return c;
29   }
30
31   inline bool isBigEndianHost() {
32     return !isLittleEndianHost();
33   }
34
35   /// getOSName() - Return the name of the host operating system or "" if
36   /// unknown.
37   std::string getOSName();
38
39   /// getOSVersion() - Return the operating system version as a string or
40   /// "" if unknown.
41   std::string getOSVersion();
42 }
43 }
44
45 #endif