Added version 2.44 defines
[platform/upstream/libsoup.git] / libsoup / soup-version.h.in
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * soup-version.h: Version information
4  *
5  * Copyright (C) 2012 Igalia S.L.
6  */
7
8 #ifndef SOUP_VERSION_H
9 #define SOUP_VERSION_H
10
11 #include <glib.h>
12
13 G_BEGIN_DECLS
14
15 #define SOUP_MAJOR_VERSION (@SOUP_MAJOR_VERSION@)
16 #define SOUP_MINOR_VERSION (@SOUP_MINOR_VERSION@)
17 #define SOUP_MICRO_VERSION (@SOUP_MICRO_VERSION@)
18
19 #define SOUP_CHECK_VERSION(major, minor, micro) \
20     (SOUP_MAJOR_VERSION > (major) || \
21     (SOUP_MAJOR_VERSION == (major) && SOUP_MINOR_VERSION > (minor)) || \
22     (SOUP_MAJOR_VERSION == (major) && SOUP_MINOR_VERSION == (minor) && \
23      SOUP_MICRO_VERSION >= (micro)))
24
25 guint    soup_get_major_version (void);
26
27 guint    soup_get_minor_version (void);
28
29 guint    soup_get_micro_version (void);
30
31 gboolean soup_check_version     (guint major,
32                                  guint minor,
33                                  guint micro);
34
35 /* Deprecation / Availability macros */
36
37 #define SOUP_ENCODE_VERSION(major,minor) ((major) << 16 | (minor) << 8)
38
39 #define SOUP_VERSION_2_24 (SOUP_ENCODE_VERSION (2, 24))
40 #define SOUP_VERSION_2_26 (SOUP_ENCODE_VERSION (2, 26))
41 #define SOUP_VERSION_2_28 (SOUP_ENCODE_VERSION (2, 28))
42 #define SOUP_VERSION_2_30 (SOUP_ENCODE_VERSION (2, 30))
43 #define SOUP_VERSION_2_32 (SOUP_ENCODE_VERSION (2, 32))
44 #define SOUP_VERSION_2_34 (SOUP_ENCODE_VERSION (2, 34))
45 #define SOUP_VERSION_2_36 (SOUP_ENCODE_VERSION (2, 36))
46 #define SOUP_VERSION_2_38 (SOUP_ENCODE_VERSION (2, 38))
47 #define SOUP_VERSION_2_40 (SOUP_ENCODE_VERSION (2, 40))
48 #define SOUP_VERSION_2_42 (SOUP_ENCODE_VERSION (2, 42))
49 #define SOUP_VERSION_2_44 (SOUP_ENCODE_VERSION (2, 44))
50
51 /* evaluates to the current stable version; for development cycles,
52  * this means the next stable target
53  */
54 #if (SOUP_MINOR_VERSION % 2)
55 #define SOUP_VERSION_CUR_STABLE (SOUP_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION + 1))
56 #else
57 #define SOUP_VERSION_CUR_STABLE (SOUP_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION))
58 #endif
59
60 /* evaluates to the previous stable version */
61 #if (SOUP_MINOR_VERSION % 2)
62 #define SOUP_VERSION_PREV_STABLE (SOUP_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION - 1))
63 #else
64 #define SOUP_VERSION_PREV_STABLE (SOUP_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION - 2))
65 #endif
66
67 #ifndef SOUP_VERSION_MIN_REQUIRED
68 # define SOUP_VERSION_MIN_REQUIRED (SOUP_VERSION_CUR_STABLE)
69 #elif SOUP_VERSION_MIN_REQUIRED == 0
70 # undef  SOUP_VERSION_MIN_REQUIRED
71 # define SOUP_VERSION_MIN_REQUIRED (SOUP_VERSION_CUR_STABLE + 2)
72 #endif
73
74 #if !defined (SOUP_VERSION_MAX_ALLOWED) || (SOUP_VERSION_MAX_ALLOWED == 0)
75 # undef SOUP_VERSION_MAX_ALLOWED
76 # define SOUP_VERSION_MAX_ALLOWED (SOUP_VERSION_CUR_STABLE)
77 #endif
78
79 /* sanity checks */
80 #if SOUP_VERSION_MIN_REQUIRED > SOUP_VERSION_CUR_STABLE
81 #error "SOUP_VERSION_MIN_REQUIRED must be <= SOUP_VERSION_CUR_STABLE"
82 #endif
83 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_MIN_REQUIRED
84 #error "SOUP_VERSION_MAX_ALLOWED must be >= SOUP_VERSION_MIN_REQUIRED"
85 #endif
86 #if SOUP_VERSION_MIN_REQUIRED < SOUP_VERSION_2_24
87 #error "SOUP_VERSION_MIN_REQUIRED must be >= SOUP_VERSION_2_24"
88 #endif
89
90 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_24
91 # define SOUP_DEPRECATED_IN_2_24                GLIB_DEPRECATED
92 # define SOUP_DEPRECATED_IN_2_24_FOR(f)         GLIB_DEPRECATED_FOR(f)
93 #else
94 # define SOUP_DEPRECATED_IN_2_24
95 # define SOUP_DEPRECATED_IN_2_24_FOR(f)
96 #endif
97
98 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_24
99 # define SOUP_AVAILABLE_IN_2_24                 GLIB_UNAVAILABLE(2, 24)
100 #else
101 # define SOUP_AVAILABLE_IN_2_24
102 #endif
103
104 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_26
105 # define SOUP_DEPRECATED_IN_2_26                GLIB_DEPRECATED
106 # define SOUP_DEPRECATED_IN_2_26_FOR(f)         GLIB_DEPRECATED_FOR(f)
107 #else
108 # define SOUP_DEPRECATED_IN_2_26
109 # define SOUP_DEPRECATED_IN_2_26_FOR(f)
110 #endif
111
112 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_26
113 # define SOUP_AVAILABLE_IN_2_26                 GLIB_UNAVAILABLE(2, 26)
114 #else
115 # define SOUP_AVAILABLE_IN_2_26
116 #endif
117
118 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_28
119 # define SOUP_DEPRECATED_IN_2_28                GLIB_DEPRECATED
120 # define SOUP_DEPRECATED_IN_2_28_FOR(f)         GLIB_DEPRECATED_FOR(f)
121 #else
122 # define SOUP_DEPRECATED_IN_2_28
123 # define SOUP_DEPRECATED_IN_2_28_FOR(f)
124 #endif
125
126 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_28
127 # define SOUP_AVAILABLE_IN_2_28                 GLIB_UNAVAILABLE(2, 28)
128 #else
129 # define SOUP_AVAILABLE_IN_2_28
130 #endif
131
132 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_30
133 # define SOUP_DEPRECATED_IN_2_30                GLIB_DEPRECATED
134 # define SOUP_DEPRECATED_IN_2_30_FOR(f)         GLIB_DEPRECATED_FOR(f)
135 #else
136 # define SOUP_DEPRECATED_IN_2_30
137 # define SOUP_DEPRECATED_IN_2_30_FOR(f)
138 #endif
139
140 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_30
141 # define SOUP_AVAILABLE_IN_2_30                 GLIB_UNAVAILABLE(2, 30)
142 #else
143 # define SOUP_AVAILABLE_IN_2_30
144 #endif
145
146 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_32
147 # define SOUP_DEPRECATED_IN_2_32                GLIB_DEPRECATED
148 # define SOUP_DEPRECATED_IN_2_32_FOR(f)         GLIB_DEPRECATED_FOR(f)
149 #else
150 # define SOUP_DEPRECATED_IN_2_32
151 # define SOUP_DEPRECATED_IN_2_32_FOR(f)
152 #endif
153
154 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_32
155 # define SOUP_AVAILABLE_IN_2_32                 GLIB_UNAVAILABLE(2, 32)
156 #else
157 # define SOUP_AVAILABLE_IN_2_32
158 #endif
159
160 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_34
161 # define SOUP_DEPRECATED_IN_2_34                GLIB_DEPRECATED
162 # define SOUP_DEPRECATED_IN_2_34_FOR(f)         GLIB_DEPRECATED_FOR(f)
163 #else
164 # define SOUP_DEPRECATED_IN_2_34
165 # define SOUP_DEPRECATED_IN_2_34_FOR(f)
166 #endif
167
168 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_34
169 # define SOUP_AVAILABLE_IN_2_34                 GLIB_UNAVAILABLE(2, 34)
170 #else
171 # define SOUP_AVAILABLE_IN_2_34
172 #endif
173
174 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_36
175 # define SOUP_DEPRECATED_IN_2_36                GLIB_DEPRECATED
176 # define SOUP_DEPRECATED_IN_2_36_FOR(f)         GLIB_DEPRECATED_FOR(f)
177 #else
178 # define SOUP_DEPRECATED_IN_2_36
179 # define SOUP_DEPRECATED_IN_2_36_FOR(f)
180 #endif
181
182 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_36
183 # define SOUP_AVAILABLE_IN_2_36                 GLIB_UNAVAILABLE(2, 36)
184 #else
185 # define SOUP_AVAILABLE_IN_2_36
186 #endif
187
188 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_38
189 # define SOUP_DEPRECATED_IN_2_38                GLIB_DEPRECATED
190 # define SOUP_DEPRECATED_IN_2_38_FOR(f)         GLIB_DEPRECATED_FOR(f)
191 #else
192 # define SOUP_DEPRECATED_IN_2_38
193 # define SOUP_DEPRECATED_IN_2_38_FOR(f)
194 #endif
195
196 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_38
197 # define SOUP_AVAILABLE_IN_2_38                 GLIB_UNAVAILABLE(2, 38)
198 #else
199 # define SOUP_AVAILABLE_IN_2_38
200 #endif
201
202 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_40
203 # define SOUP_DEPRECATED_IN_2_40                GLIB_DEPRECATED
204 # define SOUP_DEPRECATED_IN_2_40_FOR(f)         GLIB_DEPRECATED_FOR(f)
205 #else
206 # define SOUP_DEPRECATED_IN_2_40
207 # define SOUP_DEPRECATED_IN_2_40_FOR(f)
208 #endif
209
210 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_40
211 # define SOUP_AVAILABLE_IN_2_40                 GLIB_UNAVAILABLE(2, 40)
212 #else
213 # define SOUP_AVAILABLE_IN_2_40
214 #endif
215
216 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_42
217 # define SOUP_DEPRECATED_IN_2_42                GLIB_DEPRECATED
218 # define SOUP_DEPRECATED_IN_2_42_FOR(f)         GLIB_DEPRECATED_FOR(f)
219 #else
220 # define SOUP_DEPRECATED_IN_2_42
221 # define SOUP_DEPRECATED_IN_2_42_FOR(f)
222 #endif
223
224 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_42
225 # define SOUP_AVAILABLE_IN_2_42                 GLIB_UNAVAILABLE(2, 42)
226 #else
227 # define SOUP_AVAILABLE_IN_2_42
228 #endif
229
230 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_44
231 # define SOUP_DEPRECATED_IN_2_44                GLIB_DEPRECATED
232 # define SOUP_DEPRECATED_IN_2_44_FOR(f)         GLIB_DEPRECATED_FOR(f)
233 #else
234 # define SOUP_DEPRECATED_IN_2_44
235 # define SOUP_DEPRECATED_IN_2_44_FOR(f)
236 #endif
237
238 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_44
239 # define SOUP_AVAILABLE_IN_2_44                 GLIB_UNAVAILABLE(2, 44)
240 #else
241 # define SOUP_AVAILABLE_IN_2_44
242 #endif
243
244 G_END_DECLS
245
246 #endif /* SOUP_VERSION_H */