Debian Codegraph @

include/kate/kate_config.h

raw
1 /* Copyright (C) 2008 Vincent Penquerc'h.
2 This file is part of the Kate codec library.
3 Written by Vincent Penquerc'h.
4
5 Use, distribution and reproduction of this library is governed
6 by a BSD style source license included with this source in the
7 file 'COPYING'. Please read these terms before distributing. */
8
9 #ifndef KATE_kate_config_h_GUARD
10 #define KATE_kate_config_h_GUARD
11
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
15
16 #define __STDC_FORMAT_MACROS
17
18 #include <stddef.h>
19 #include <limits.h>
20 #include <sys/types.h>
21
22 #ifdef HAVE_INTTYPES_H
23 #include <inttypes.h>
24 #endif
25
26 #ifdef HAVE_STDINT_H
27 #include <stdint.h>
28 #endif
29
30 #ifdef KATE_INTERNAL
31 #define kate_const
32 #else
33 #define kate_const const
34 #endif
35
36 #ifndef kate_malloc
37 #define kate_malloc malloc
38 #endif
39 #ifndef kate_realloc
40 #define kate_realloc realloc
41 #endif
42 #ifndef kate_free
43 #define kate_free free
44 #endif
45
46 #if defined HAVE_STDINT_H || defined HAVE_INTTYPES_H
47 typedef int32_t kate_int32_t;
48 #elif defined int32_t
49 typedef int32_t kate_int32_t;
50 #elif defined INT_MAX && INT_MAX==2147483647
51 typedef int kate_int32_t;
52 #elif defined SHRT_MAX && SHRT_MAX==2147483647
53 typedef short int kate_int32_t;
54 #elif defined LONG_MAX && LONG_MAX==2147483647
55 typedef long int kate_int32_t;
56 #elif defined LLONG_MAX && LLONG_MAX==2147483647
57 typedef long long int kate_int32_t;
58 #else
59 #error No 32 bit signed integer found
60 #endif
61
62 #if defined HAVE_STDINT_H || defined HAVE_INTTYPES_H
63 typedef uint32_t kate_uint32_t;
64 #elif defined uint32_t
65 typedef uint32_t kate_uint32_t;
66 #elif defined UINT_MAX && UINT_MAX==4294967295u
67 typedef unsigned int kate_uint32_t;
68 #elif defined USHRT_MAX && USHRT_MAX==4294967295u
69 typedef short unsigned int kate_uint32_t;
70 #elif defined ULONG_MAX && ULONG_MAX==4294967295ul
71 typedef long unsigned int kate_uint32_t;
72 #elif defined ULLONG_MAX && ULLONG_MAX==4294967295ull
73 typedef long long unsigned int kate_uint32_t;
74 #else
75 #error No 32 bit unsigned integer found
76 #endif
77
78 #if defined HAVE_STDINT_H || defined HAVE_INTTYPES_H
79 typedef int64_t kate_int64_t;
80 #elif defined int64_t
81 typedef int64_t kate_int64_t;
82 #elif defined INT_MAX && INT_MAX>2147483647
83 typedef int kate_int64_t;
84 #elif defined SHRT_MAX && SHRT_MAX>2147483647
85 typedef short int kate_int64_t;
86 #elif defined LONG_MAX && LONG_MAX>2147483647
87 typedef long int kate_int64_t;
88 #elif defined LLONG_MAX && LLONG_MAX>2147483647
89 typedef long long int kate_int64_t;
90 #elif defined LONG_LONG_MAX && LONG_LONG_MAX>2147483647
91 typedef long long int kate_int64_t;
92 #elif defined __GNUC__ && __GNUC__>=4 && defined __WORDSIZE && __WORDSIZE==64
93 /* this case matches glibc, check conservative GCC version just in case */
94 typedef long int kate_int64_t;
95 #elif defined __GNUC__ && __GNUC__>=4 && defined __WORDSIZE && __WORDSIZE==32
96 /* this case matches glibc, check conservative GCC version just in case */
97 typedef long long int kate_int64_t;
98 #else
99 #error No 64 bit signed integer found
100 #endif
101
102 #if defined HAVE_STDINT_H || defined HAVE_INTTYPES_H
103 typedef uint64_t kate_uint64_t;
104 #elif defined uint64_t
105 typedef uint64_t kate_uint64_t;
106 #elif defined UINT_MAX && UINT_MAX>4294967295u
107 typedef unsigned int kate_uint64_t;
108 #elif defined USHRT_MAX && USHRT_MAX>4294967295u
109 typedef unsigned short int kate_uint64_t;
110 #elif defined ULONG_MAX && ULONG_MAX>4294967295ul
111 typedef unsigned long int kate_uint64_t;
112 #elif defined ULLONG_MAX && ULLONG_MAX>4294967295ull
113 typedef unsigned long long int kate_uint64_t;
114 #elif defined ULONG_LONG_MAX && ULONG_LONG_MAX>4294967295ull
115 typedef unsigned long long int kate_uint64_t;
116 #elif defined __GNUC__ && __GNUC__>=4 && defined __WORDSIZE && __WORDSIZE==64
117 /* this case matches glibc, check conservative GCC version just in case */
118 typedef unsigned long int kate_uint64_t;
119 #elif defined __GNUC__ && __GNUC__>=4 && defined __WORDSIZE && __WORDSIZE==32
120 /* this case matches glibc, check conservative GCC version just in case */
121 typedef unsigned long long int kate_uint64_t;
122 #else
123 #error No 64 bit unsigned signed integer found
124 #endif
125
126 #if defined HAVE_STDINT_H || defined HAVE_INTTYPES_H
127 typedef uintptr_t kate_uintptr_t;
128 #elif defined uintptr_t
129 typedef uintptr_t kate_uintptr_t;
130 #else
131 typedef size_t kate_uintptr_t;
132 #endif
133
134 typedef float kate_float;
135
136 #endif
137