• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "unicode/platform.h"
26 
27 /*===========================================================================*/
28 /* Generic data types                                                        */
29 /*===========================================================================*/
30 
31 /* If your platform does not have the <inttypes.h> header, you may
32    need to edit the typedefs below. */
33 #if U_HAVE_INTTYPES_H
34 
35 /* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
36 /* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
37 /* doesn't have uint8_t depending on the OS version. */
38 /* So we have this work around. */
39 #ifdef OS390
40 /* The features header is needed to get (u)int64_t sometimes. */
41 #include <features.h>
42 #if ! U_HAVE_INT8_T
43 typedef signed char int8_t;
44 #endif
45 #if !defined(__uint8_t)
46 #define __uint8_t 1
47 typedef unsigned char uint8_t;
48 #endif
49 #endif /* OS390 */
50 
51 #include <inttypes.h>
52 
53 #else /* U_HAVE_INTTYPES_H */
54 
55 #if ! U_HAVE_INT8_T
56 typedef signed char int8_t;
57 #endif
58 
59 #if ! U_HAVE_UINT8_T
60 typedef unsigned char uint8_t;
61 #endif
62 
63 #if ! U_HAVE_INT16_T
64 typedef signed short int16_t;
65 #endif
66 
67 #if ! U_HAVE_UINT16_T
68 typedef unsigned short uint16_t;
69 #endif
70 
71 #if ! U_HAVE_INT32_T
72 typedef signed int int32_t;
73 #endif
74 
75 #if ! U_HAVE_UINT32_T
76 typedef unsigned int uint32_t;
77 #endif
78 
79 #if ! U_HAVE_INT64_T
80     typedef signed long long int64_t;
81 /* else we may not have a 64-bit type */
82 #endif
83 
84 #if ! U_HAVE_UINT64_T
85     typedef unsigned long long uint64_t;
86 /* else we may not have a 64-bit type */
87 #endif
88 
89 #endif /* U_HAVE_INTTYPES_H */
90 
91 #endif /* _PTYPES_H */
92 
93