LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DataTypes.h

Go to the documentation of this file.
00001 /* include/llvm/Support/DataTypes.h.  Generated by configure.  */
00002 //===-- include/Support/DataTypes.h - Define fixed size types ---*- C++ -*-===//
00003 //
00004 //                     The LLVM Compiler Infrastructure
00005 //
00006 // This file was developed by the LLVM research group and is distributed under
00007 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00008 //
00009 //===----------------------------------------------------------------------===//
00010 //
00011 // This file contains definitions to figure out the size of _HOST_ data types.
00012 // This file is important because different host OS's define different macros,
00013 // which makes portability tough.  This file exports the following definitions:
00014 //
00015 //   [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types
00016 //   [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values.
00017 //
00018 // No library is required when using these functinons.
00019 //
00020 //===----------------------------------------------------------------------===//
00021 
00022 #ifndef SUPPORT_DATATYPES_H
00023 #define SUPPORT_DATATYPES_H
00024 
00025 #include "llvm/Config/config.h"
00026 
00027 #define HAVE_SYS_TYPES_H 1
00028 #define HAVE_INTTYPES_H 1
00029 #define HAVE_STDINT_H 1
00030 
00031 #ifndef _MSC_VER
00032 
00033 // Note that this header's correct operation depends on __STDC_LIMIT_MACROS
00034 // being defined.  We would define it here, but in order to prevent Bad Things
00035 // happening when system headers or C++ STL headers include stdint.h before
00036 // we define it here, we define it on the g++ command line (in Makefile.rules).
00037 #if !defined(__STDC_LIMIT_MACROS)
00038 # error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
00039 #endif
00040 
00041 // Note that <inttypes.h> includes <stdint.h>, if this is a C99 system.
00042 #ifdef HAVE_SYS_TYPES_H
00043 #include <sys/types.h>
00044 #endif
00045 
00046 #ifdef HAVE_INTTYPES_H
00047 #include <inttypes.h>
00048 #endif
00049 
00050 #ifdef HAVE_STDINT_H
00051 #include <stdint.h>
00052 #endif
00053 
00054 #ifdef _AIX
00055 #include "llvm/Support/AIXDataTypesFix.h"
00056 #endif
00057 
00058 // Handle incorrect definition of uint64_t as u_int64_t
00059 #ifndef HAVE_UINT64_T
00060 #ifdef HAVE_U_INT64_T
00061 typedef u_int64_t uint64_t;
00062 #else
00063 # error "Don't have a definition for uint64_t on this platform"
00064 #endif
00065 #endif
00066 
00067 #else /* _MSC_VER */
00068 // Visual C++ doesn't provide standard integer headers, but it does provide
00069 // built-in data types.
00070 typedef __int64 int64_t;
00071 typedef unsigned __int64 uint64_t;
00072 typedef signed   int int32_t;
00073 typedef unsigned int uint32_t;
00074 typedef signed   int ssize_t;
00075 #define INT8_MAX 127
00076 #define INT8_MIN -128
00077 #define UINT8_MAX 255
00078 #define INT16_MAX 32767
00079 #define INT16_MIN -32768
00080 #define UINT16_MAX 65535
00081 #define INT32_MAX 2147483647
00082 #define INT32_MIN -2147483648
00083 #define UINT32_MAX 4294967295U
00084 #endif /* _MSC_VER */
00085 
00086 /* Set defaults for constants which we cannot find. */
00087 #if !defined(INT64_MAX)
00088 # define INT64_MAX 9223372036854775807LL
00089 #endif
00090 #if !defined(INT64_MIN)
00091 # define INT64_MIN ((-INT64_MAX)-1)
00092 #endif
00093 #if !defined(UINT64_MAX)
00094 # define UINT64_MAX 0xffffffffffffffffULL
00095 #endif
00096 
00097 #endif  /* SUPPORT_DATATYPES_H */