1/* include/llvm/Support/DataTypes.h. Generated from DataTypes.h.in by configure. */ 2/*===-- include/System/DataTypes.h - Define fixed size types -----*- C -*-===*\ 3|* *| 4|* The LLVM Compiler Infrastructure *| 5|* *| 6|* This file is distributed under the University of Illinois Open Source *| 7|* License. See LICENSE.TXT for details. *| 8|* *| 9|*===----------------------------------------------------------------------===*| 10|* *| 11|* This file contains definitions to figure out the size of _HOST_ data types.*| 12|* This file is important because different host OS's define different macros,*| 13|* which makes portability tough. This file exports the following *| 14|* definitions: *| 15|* *| 16|* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*| 17|* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *| 18|* *| 19|* No library is required when using these functions. *| 20|* *| 21|*===----------------------------------------------------------------------===*/ 22 23/* Please leave this file C-compatible. */ 24 25#ifndef SUPPORT_DATATYPES_H 26#define SUPPORT_DATATYPES_H 27 28#define HAVE_SYS_TYPES_H 1 29#define HAVE_INTTYPES_H 1 30#define HAVE_STDINT_H 1 31#define HAVE_UINT64_T 1 32/* #undef HAVE_U_INT64_T */ 33 34#ifdef __cplusplus 35#include <cmath> 36#else 37#include <math.h> 38#endif 39 40/* Note that this header's correct operation depends on __STDC_LIMIT_MACROS 41 being defined. We would define it here, but in order to prevent Bad Things 42 happening when system headers or C++ STL headers include stdint.h before we 43 define it here, we define it on the g++ command line (in Makefile.rules). */ 44#if !defined(__STDC_LIMIT_MACROS) 45# error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h" 46#endif 47 48#if !defined(__STDC_CONSTANT_MACROS) 49# error "Must #define __STDC_CONSTANT_MACROS before " \ 50 "#including System/DataTypes.h" 51#endif 52 53/* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */ 54#ifdef HAVE_SYS_TYPES_H 55#include <sys/types.h> 56#endif 57 58#ifdef HAVE_INTTYPES_H 59#include <inttypes.h> 60#endif 61 62#ifdef HAVE_STDINT_H 63#include <stdint.h> 64#endif 65 66#ifdef _AIX 67#include "llvm/Support/AIXDataTypesFix.h" 68#endif 69 70/* Handle incorrect definition of uint64_t as u_int64_t */ 71#ifndef HAVE_UINT64_T 72#ifdef HAVE_U_INT64_T 73typedef u_int64_t uint64_t; 74#else 75# error "Don't have a definition for uint64_t on this platform" 76#endif 77#endif 78 79#ifdef _OpenBSD_ 80#define INT8_MAX 127 81#define INT8_MIN -128 82#define UINT8_MAX 255 83#define INT16_MAX 32767 84#define INT16_MIN -32768 85#define UINT16_MAX 65535 86#define INT32_MAX 2147483647 87#define INT32_MIN -2147483648 88#define UINT32_MAX 4294967295U 89#endif 90 91/* Set defaults for constants which we cannot find. */ 92#if !defined(INT64_MAX) 93# define INT64_MAX 9223372036854775807LL 94#endif 95#if !defined(INT64_MIN) 96# define INT64_MIN ((-INT64_MAX)-1) 97#endif 98#if !defined(UINT64_MAX) 99# define UINT64_MAX 0xffffffffffffffffULL 100#endif 101 102#if __GNUC__ > 3 103#define END_WITH_NULL __attribute__((sentinel)) 104#else 105#define END_WITH_NULL 106#endif 107 108#ifndef HUGE_VALF 109#define HUGE_VALF (float)HUGE_VAL 110#endif 111 112#endif /* SUPPORT_DATATYPES_H */ 113