00001 // © 2016 and later: Unicode, Inc. and others. 00002 // License & terms of use: http://www.unicode.org/copyright.html 00003 /* 00004 ****************************************************************************** 00005 * 00006 * Copyright (C) 1997-2012, International Business Machines 00007 * Corporation and others. All Rights Reserved. 00008 * 00009 ****************************************************************************** 00010 * 00011 * FILE NAME : ptypes.h 00012 * 00013 * Date Name Description 00014 * 05/13/98 nos Creation (content moved here from ptypes.h). 00015 * 03/02/99 stephen Added AS400 support. 00016 * 03/30/99 stephen Added Linux support. 00017 * 04/13/99 stephen Reworked for autoconf. 00018 * 09/18/08 srl Moved basic types back to ptypes.h from platform.h 00019 ****************************************************************************** 00020 */ 00021 00027 #ifndef _PTYPES_H 00028 #define _PTYPES_H 00029 00038 #ifndef __STDC_LIMIT_MACROS 00039 #define __STDC_LIMIT_MACROS 00040 #endif 00041 00042 /* NULL, size_t, wchar_t */ 00043 #include <stddef.h> 00044 00045 /* 00046 * If all compilers provided all of the C99 headers and types, 00047 * we would just unconditionally #include <stdint.h> here 00048 * and not need any of the stuff after including platform.h. 00049 */ 00050 00051 /* Find out if we have stdint.h etc. */ 00052 #include "unicode/platform.h" 00053 00054 /*===========================================================================*/ 00055 /* Generic data types */ 00056 /*===========================================================================*/ 00057 00058 /* If your platform does not have the <stdint.h> header, you may 00059 need to edit the typedefs in the #else section below. 00060 Use #if...#else...#endif with predefined compiler macros if possible. */ 00061 #if U_HAVE_STDINT_H 00062 00063 /* 00064 * We mostly need <stdint.h> (which defines the standard integer types) but not <inttypes.h>. 00065 * <inttypes.h> includes <stdint.h> and adds the printf/scanf helpers PRId32, SCNx16 etc. 00066 * which we almost never use, plus stuff like imaxabs() which we never use. 00067 */ 00068 #include <stdint.h> 00069 00070 #if U_PLATFORM == U_PF_OS390 00071 /* The features header is needed to get (u)int64_t sometimes. */ 00072 #include <features.h> 00073 /* z/OS has <stdint.h>, but some versions are missing uint8_t (APAR PK62248). */ 00074 #if !defined(__uint8_t) 00075 #define __uint8_t 1 00076 typedef unsigned char uint8_t; 00077 #endif 00078 #endif /* U_PLATFORM == U_PF_OS390 */ 00079 00080 #elif U_HAVE_INTTYPES_H 00081 00082 # include <inttypes.h> 00083 00084 #else /* neither U_HAVE_STDINT_H nor U_HAVE_INTTYPES_H */ 00085 00087 #if ! U_HAVE_INT8_T 00088 typedef signed char int8_t; 00089 #endif 00090 00091 #if ! U_HAVE_UINT8_T 00092 typedef unsigned char uint8_t; 00093 #endif 00094 00095 #if ! U_HAVE_INT16_T 00096 typedef signed short int16_t; 00097 #endif 00098 00099 #if ! U_HAVE_UINT16_T 00100 typedef unsigned short uint16_t; 00101 #endif 00102 00103 #if ! U_HAVE_INT32_T 00104 typedef signed int int32_t; 00105 #endif 00106 00107 #if ! U_HAVE_UINT32_T 00108 typedef unsigned int uint32_t; 00109 #endif 00110 00111 #if ! U_HAVE_INT64_T 00112 #ifdef _MSC_VER 00113 typedef signed __int64 int64_t; 00114 #else 00115 typedef signed long long int64_t; 00116 #endif 00117 #endif 00118 00119 #if ! U_HAVE_UINT64_T 00120 #ifdef _MSC_VER 00121 typedef unsigned __int64 uint64_t; 00122 #else 00123 typedef unsigned long long uint64_t; 00124 #endif 00125 #endif 00127 00128 #endif /* U_HAVE_STDINT_H / U_HAVE_INTTYPES_H */ 00129 00130 #endif /* _PTYPES_H */
1.6.1