Add prototypes for CheckMagic, IsArchive, and IsBytecode.
[oota-llvm.git] / include / Support / DataTypes.h
1 //===-- include/Support/DataTypes.h - Define fixed size types ---*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains definitions to figure out the size of _HOST_ data types.
11 // This file is important because different host OS's define different macros,
12 // which makes portability tough.  This file exports the following definitions:
13 //
14 //   ENDIAN_LITTLE : is #define'd if the host is little endian
15 //   int64_t       : is a typedef for the signed 64 bit system type
16 //   uint64_t      : is a typedef for the unsigned 64 bit system type
17 //   INT64_MAX     : is a #define specifying the max value for int64_t's
18 //
19 // No library is required when using these functinons.
20 //
21 //===----------------------------------------------------------------------===//
22
23 #ifndef SUPPORT_DATATYPES_H
24 #define SUPPORT_DATATYPES_H
25
26 #include "Config/config.h"
27
28 // Note that this header's correct operation depends on __STDC_LIMIT_MACROS
29 // being defined.  We would define it here, but in order to prevent Bad Things
30 // happening when system headers or C++ STL headers include stdint.h before
31 // we define it here, we define it on the g++ command line (in Makefile.rules).
32
33 #ifdef HAVE_STDINT_H
34 #include <stdint.h>
35 #endif
36
37 #ifdef HAVE_INTTYPES_H
38 #include <inttypes.h>
39 #endif
40
41 #ifdef HAVE_SYS_TYPES_H
42 #include <sys/types.h>
43 #endif
44
45 #if (defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG))
46 #error "Cannot define both ENDIAN_LITTLE and ENDIAN_BIG!"
47 #endif
48
49 #if (!defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG))
50 #error "include/Support/DataTypes.h could not determine endianness!"
51 #endif
52
53 #if !defined(INT64_MAX)
54 /* We couldn't determine INT64_MAX; default it. */
55 #define INT64_MAX 9223372036854775807LL
56 #endif
57 #if !defined(UINT64_MAX)
58 #define UINT64_MAX 0xffffffffffffffffULL
59 #endif
60
61 #endif  /* SUPPORT_DATATYPES_H */