Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:01

0001 /*===-- include/llvm-c/DataTypes.h - Define fixed size types ------*- C -*-===*\
0002 |*                                                                            *|
0003 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
0004 |* Exceptions.                                                                *|
0005 |* See https://llvm.org/LICENSE.txt for license information.                  *|
0006 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
0007 |*                                                                            *|
0008 |*===----------------------------------------------------------------------===*|
0009 |*                                                                            *|
0010 |* This file contains definitions to figure out the size of _HOST_ data types.*|
0011 |* This file is important because different host OS's define different macros,*|
0012 |* which makes portability tough.  This file exports the following            *|
0013 |* definitions:                                                               *|
0014 |*                                                                            *|
0015 |*   [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*|
0016 |*   [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values.     *|
0017 |*                                                                            *|
0018 |* No library is required when using these functions.                         *|
0019 |*                                                                            *|
0020 |*===----------------------------------------------------------------------===*/
0021 
0022 /* Please leave this file C-compatible. */
0023 
0024 #ifndef LLVM_C_DATATYPES_H
0025 #define LLVM_C_DATATYPES_H
0026 
0027 #include <inttypes.h>
0028 #include <stdint.h>
0029 
0030 #ifndef _MSC_VER
0031 
0032 #if !defined(UINT32_MAX)
0033 # error "The standard header <cstdint> is not C++11 compliant. Must #define "\
0034         "__STDC_LIMIT_MACROS before #including llvm-c/DataTypes.h"
0035 #endif
0036 
0037 #if !defined(UINT32_C)
0038 # error "The standard header <cstdint> is not C++11 compliant. Must #define "\
0039         "__STDC_CONSTANT_MACROS before #including llvm-c/DataTypes.h"
0040 #endif
0041 
0042 /* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */
0043 #include <sys/types.h>
0044 
0045 #ifdef _AIX
0046 // GCC is strict about defining large constants: they must have LL modifier.
0047 #undef INT64_MAX
0048 #undef INT64_MIN
0049 #endif
0050 
0051 #else /* _MSC_VER */
0052 #ifdef __cplusplus
0053 #include <cstddef>
0054 #include <cstdlib>
0055 #else
0056 #include <stddef.h>
0057 #include <stdlib.h>
0058 #endif
0059 #include <sys/types.h>
0060 
0061 #if defined(_WIN64)
0062 typedef signed __int64 ssize_t;
0063 #else
0064 typedef signed int ssize_t;
0065 #endif /* _WIN64 */
0066 
0067 #endif /* _MSC_VER */
0068 
0069 /* Set defaults for constants which we cannot find. */
0070 #if !defined(INT64_MAX)
0071 # define INT64_MAX 9223372036854775807LL
0072 #endif
0073 #if !defined(INT64_MIN)
0074 # define INT64_MIN ((-INT64_MAX)-1)
0075 #endif
0076 #if !defined(UINT64_MAX)
0077 # define UINT64_MAX 0xffffffffffffffffULL
0078 #endif
0079 
0080 #endif /* LLVM_C_DATATYPES_H */