Don't attribute in file headers anymore. See llvmdev for the
[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 namespace llvm {
18 namespace sys {
19
20   inline bool littleEndianHost() {
21     union {
22       int i;
23       char c;
24     };
25     i = 1;
26     return c;
27   }
28
29   inline bool bigEndianHost() {
30     return !littleEndianHost();
31   }
32
33 }
34 }
35
36 #endif