]> granicus.if.org Git - zziplib/blob - zzip/stdint.h
fixing some issues about variable declarations in the middle of a block
[zziplib] / zzip / stdint.h
1 #ifndef _ZZIP__STDINT_H /* zzip-stdint.h */\r
2 #define _ZZIP__STDINT_H 1\r
3 /* this file ensures that we have some kind of typedef declarations for\r
4    unsigned C9X typedefs. The ISO C 9X: 7.18 Integer types file is stdint.h\r
5  */\r
6 \r
7 #include <zzip/conf.h> \r
8 \r
9 /* enforce use of ifdef'd C9X entries in system headers */\r
10 #define __USE_ANSI 1\r
11 #define __USE_ISOC9X 1\r
12 \r
13 #ifdef ZZIP_HAVE_STDINT_H\r
14     /* ISO C 9X: 7.18 Integer types <stdint.h> */\r
15 #include <stdint.h>\r
16 #elif defined ZZIP_HAVE_SYS_INT_TYPES_H /*solaris*/\r
17 #include <sys/int_types.h>\r
18 #elif defined ZZIP_HAVE_INTTYPES_H /*freebsd*/\r
19 #include <inttypes.h>\r
20 #else\r
21     typedef unsigned char uint8_t;      typedef signed char int8_t;\r
22 \r
23 # if ZZIP_SIZEOF_INT && ZZIP_SIZEOF_INT == 2\r
24     typedef unsigned int uint16_t;      typedef signed int int16_t;\r
25 # elif ZZIP_SIZEOF_SHORT && ZZIP_SIZEOF_SHORT == 2\r
26     typedef unsigned short uint16_t;    typedef signed short int16_t;\r
27 # else\r
28 #   error unable to typedef int16_t from either int or short\r
29     typedef unsigned short uint16_t;    typedef signed short int16_t;\r
30 # endif\r
31 \r
32 # if defined ZZIP_SIZEOF_INT && ZZIP_SIZEOF_INT == 4\r
33     typedef unsigned int uint32_t;      typedef signed int int32_t;\r
34 # elif defined ZZIP_SIZEOF_LONG && ZZIP_SIZEOF_LONG == 4\r
35     typedef unsigned long uint32_t;     typedef signed long int32_t;\r
36 # else\r
37 #   error unable to typedef int32_t from either int or long\r
38     typedef unsigned long uint32_t;     typedef signed long int32_t;\r
39 # endif\r
40 #endif\r
41 \r
42 #endif /*_ZZIP_STDINT_H*/\r
43 \r