Rudiments
inttypes.h
1 // Copyright (c) 2005 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_INTTYPES_H
5 #define RUDIMENTS_INTTYPES_H
6 
7 #include <rudiments/private/config.h>
8 
9 // define NULL...
10 
11 // NULL is typically defined in stddef.h
12 #include <stddef.h>
13 
14 // Certain versions of gcc define NULL as ((void *)0) and then complain when
15 // you set a const pointer to it. Work around that.
16 #ifdef RUDIMENTS_REDEFINE_NULL
17 #undef NULL
18 #define NULL 0
19 #endif
20 
21 
22 // define [u]int(8|16|32|64)_t...
23 
24 #if defined(RUDIMENTS_HAVE_STDINT_H)
25  #include <stdint.h>
26 #elif defined(RUDIMENTS_HAVE_SYS_BITYPES_H)
27  // Tru64 needs __arch64__ for int64_t and uint64_t typedefs
28  #ifndef __arch64__
29  #define __arch64__
30  #endif
31  #include <sys/bitypes.h>
32 #elif defined(RUDIMENTS_HAVE_INTTYPES_H)
33  #include <inttypes.h>
34 #endif
35 
36 #ifndef RUDIMENTS_HAVE_INT8_T
37  typedef signed char int8_t;
38 #endif
39 #ifndef RUDIMENTS_HAVE_UINT8_T
40  typedef unsigned char uint8_t;
41 #endif
42 #ifndef RUDIMENTS_HAVE_INT16_T
43  typedef signed short int16_t;
44 #endif
45 #ifndef RUDIMENTS_HAVE_UINT16_T
46  typedef unsigned short uint16_t;
47 #endif
48 #ifndef RUDIMENTS_HAVE_INT32_T
49  typedef signed int int32_t;
50 #endif
51 #ifndef RUDIMENTS_HAVE_UINT32_T
52  typedef unsigned int uint32_t;
53 #endif
54 #ifndef RUDIMENTS_HAVE_INT64_T
55  typedef signed long long int64_t;
56 #endif
57 #ifndef RUDIMENTS_HAVE_UINT64_T
58  typedef unsigned long long uint64_t;
59 #endif
60 
61 #endif