OLD | NEW |
| (Empty) |
1 /* | |
2 ****************************************************************************** | |
3 * | |
4 * Copyright (C) 1997-2010, International Business Machines | |
5 * Corporation and others. All Rights Reserved. | |
6 * | |
7 ****************************************************************************** | |
8 * | |
9 * FILE NAME : ptypes.h | |
10 * | |
11 * Date Name Description | |
12 * 05/13/98 nos Creation (content moved here from ptypes.h). | |
13 * 03/02/99 stephen Added AS400 support. | |
14 * 03/30/99 stephen Added Linux support. | |
15 * 04/13/99 stephen Reworked for autoconf. | |
16 * 09/18/08 srl Moved basic types back to ptypes.h from platform.h | |
17 ****************************************************************************** | |
18 */ | |
19 | |
20 #ifndef _PTYPES_H | |
21 #define _PTYPES_H | |
22 | |
23 #include <sys/types.h> | |
24 | |
25 #if defined(__APPLE__) | |
26 # include "unicode/pmac.h" | |
27 #elif defined(__linux__) | |
28 # include "unicode/plinux.h" | |
29 #else | |
30 # include "unicode/platform.h" | |
31 #endif | |
32 | |
33 /*===========================================================================*/ | |
34 /* Generic data types */ | |
35 /*===========================================================================*/ | |
36 | |
37 /* If your platform does not have the <inttypes.h> header, you may | |
38 need to edit the typedefs below. */ | |
39 #if U_HAVE_INTTYPES_H | |
40 | |
41 /* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */ | |
42 /* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */ | |
43 /* doesn't have uint8_t depending on the OS version. */ | |
44 /* So we have this work around. */ | |
45 #ifdef OS390 | |
46 /* The features header is needed to get (u)int64_t sometimes. */ | |
47 #include <features.h> | |
48 #if ! U_HAVE_INT8_T | |
49 typedef signed char int8_t; | |
50 #endif | |
51 #if !defined(__uint8_t) | |
52 #define __uint8_t 1 | |
53 typedef unsigned char uint8_t; | |
54 #endif | |
55 #endif /* OS390 */ | |
56 | |
57 #include <inttypes.h> | |
58 | |
59 #else /* U_HAVE_INTTYPES_H */ | |
60 | |
61 #if ! U_HAVE_INT8_T | |
62 typedef signed char int8_t; | |
63 #endif | |
64 | |
65 #if ! U_HAVE_UINT8_T | |
66 typedef unsigned char uint8_t; | |
67 #endif | |
68 | |
69 #if ! U_HAVE_INT16_T | |
70 typedef signed short int16_t; | |
71 #endif | |
72 | |
73 #if ! U_HAVE_UINT16_T | |
74 typedef unsigned short uint16_t; | |
75 #endif | |
76 | |
77 #if ! U_HAVE_INT32_T | |
78 typedef signed int int32_t; | |
79 #endif | |
80 | |
81 #if ! U_HAVE_UINT32_T | |
82 typedef unsigned int uint32_t; | |
83 #endif | |
84 | |
85 #if ! U_HAVE_INT64_T | |
86 typedef signed long long int64_t; | |
87 /* else we may not have a 64-bit type */ | |
88 #endif | |
89 | |
90 #if ! U_HAVE_UINT64_T | |
91 typedef unsigned long long uint64_t; | |
92 /* else we may not have a 64-bit type */ | |
93 #endif | |
94 | |
95 #endif /* U_HAVE_INTTYPES_H */ | |
96 | |
97 #endif /* _PTYPES_H */ | |
OLD | NEW |