1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * soup-version.h: Version information
5 * Copyright (C) 2012 Igalia S.L.
8 #ifndef __SOUP_VERSION_H__
9 #define __SOUP_VERSION_H__
15 #define SOUP_MAJOR_VERSION (@SOUP_MAJOR_VERSION@)
16 #define SOUP_MINOR_VERSION (@SOUP_MINOR_VERSION@)
17 #define SOUP_MICRO_VERSION (@SOUP_MICRO_VERSION@)
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)))
26 #define _SOUP_EXTERN extern
29 /* We prefix variable declarations so they can
30 * properly get exported in Windows DLLs.
33 # ifdef G_PLATFORM_WIN32
34 # ifdef LIBSOUP_COMPILATION
36 # define SOUP_VAR __declspec(dllexport)
37 # else /* !DLL_EXPORT */
38 # define SOUP_VAR extern
39 # endif /* !DLL_EXPORT */
40 # else /* !SOUP_COMPILATION */
41 # define SOUP_VAR extern __declspec(dllimport)
42 # endif /* !LIBSOUP_COMPILATION */
43 # else /* !G_PLATFORM_WIN32 */
44 # define SOUP_VAR _SOUP_EXTERN
45 # endif /* !G_PLATFORM_WIN32 */
48 /* Deprecation / Availability macros */
50 #define SOUP_VERSION_2_24 (G_ENCODE_VERSION (2, 24))
51 #define SOUP_VERSION_2_26 (G_ENCODE_VERSION (2, 26))
52 #define SOUP_VERSION_2_28 (G_ENCODE_VERSION (2, 28))
53 #define SOUP_VERSION_2_30 (G_ENCODE_VERSION (2, 30))
54 #define SOUP_VERSION_2_32 (G_ENCODE_VERSION (2, 32))
55 #define SOUP_VERSION_2_34 (G_ENCODE_VERSION (2, 34))
56 #define SOUP_VERSION_2_36 (G_ENCODE_VERSION (2, 36))
57 #define SOUP_VERSION_2_38 (G_ENCODE_VERSION (2, 38))
58 #define SOUP_VERSION_2_40 (G_ENCODE_VERSION (2, 40))
59 #define SOUP_VERSION_2_42 (G_ENCODE_VERSION (2, 42))
60 #define SOUP_VERSION_2_44 (G_ENCODE_VERSION (2, 44))
61 #define SOUP_VERSION_2_46 (G_ENCODE_VERSION (2, 46))
62 #define SOUP_VERSION_2_48 (G_ENCODE_VERSION (2, 48))
63 #define SOUP_VERSION_2_50 (G_ENCODE_VERSION (2, 50))
64 #define SOUP_VERSION_2_52 (G_ENCODE_VERSION (2, 52))
65 #define SOUP_VERSION_2_54 (G_ENCODE_VERSION (2, 54))
66 #define SOUP_VERSION_2_56 (G_ENCODE_VERSION (2, 56))
67 #define SOUP_VERSION_2_58 (G_ENCODE_VERSION (2, 58))
68 #define SOUP_VERSION_2_62 (G_ENCODE_VERSION (2, 62))
69 #define SOUP_VERSION_2_66 (G_ENCODE_VERSION (2, 66))
70 #define SOUP_VERSION_2_68 (G_ENCODE_VERSION (2, 68))
71 #define SOUP_VERSION_2_70 (G_ENCODE_VERSION (2, 70))
72 #define SOUP_VERSION_2_72 (G_ENCODE_VERSION (2, 72))
74 /* evaluates to the current stable version; for development cycles,
75 * this means the next stable target
77 #if (SOUP_MINOR_VERSION % 2)
78 #define SOUP_VERSION_CUR_STABLE (G_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION + 1))
80 #define SOUP_VERSION_CUR_STABLE (G_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION))
83 /* evaluates to the previous stable version */
84 #if (SOUP_MINOR_VERSION % 2)
85 #define SOUP_VERSION_PREV_STABLE (G_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION - 1))
87 #define SOUP_VERSION_PREV_STABLE (G_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION - 2))
90 #ifndef SOUP_VERSION_MIN_REQUIRED
91 # define SOUP_VERSION_MIN_REQUIRED (SOUP_VERSION_CUR_STABLE)
92 #elif SOUP_VERSION_MIN_REQUIRED == 0
93 # undef SOUP_VERSION_MIN_REQUIRED
94 # define SOUP_VERSION_MIN_REQUIRED (SOUP_VERSION_CUR_STABLE + 2)
97 #if !defined (SOUP_VERSION_MAX_ALLOWED) || (SOUP_VERSION_MAX_ALLOWED == 0)
98 # undef SOUP_VERSION_MAX_ALLOWED
99 # define SOUP_VERSION_MAX_ALLOWED (SOUP_VERSION_CUR_STABLE)
103 #if SOUP_VERSION_MIN_REQUIRED > SOUP_VERSION_CUR_STABLE
104 #error "SOUP_VERSION_MIN_REQUIRED must be <= SOUP_VERSION_CUR_STABLE"
106 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_MIN_REQUIRED
107 #error "SOUP_VERSION_MAX_ALLOWED must be >= SOUP_VERSION_MIN_REQUIRED"
109 #if SOUP_VERSION_MIN_REQUIRED < SOUP_VERSION_2_24
110 #error "SOUP_VERSION_MIN_REQUIRED must be >= SOUP_VERSION_2_24"
113 #define SOUP_AVAILABLE_IN_2_4 _SOUP_EXTERN
115 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_24
116 # define SOUP_DEPRECATED_IN_2_24 G_DEPRECATED
117 # define SOUP_DEPRECATED_IN_2_24_FOR(f) G_DEPRECATED_FOR(f)
119 # define SOUP_DEPRECATED_IN_2_24
120 # define SOUP_DEPRECATED_IN_2_24_FOR(f)
123 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_24
124 # define SOUP_AVAILABLE_IN_2_24 G_UNAVAILABLE(2, 24) _SOUP_EXTERN
126 # define SOUP_AVAILABLE_IN_2_24 _SOUP_EXTERN
129 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_26
130 # define SOUP_DEPRECATED_IN_2_26 G_DEPRECATED
131 # define SOUP_DEPRECATED_IN_2_26_FOR(f) G_DEPRECATED_FOR(f)
133 # define SOUP_DEPRECATED_IN_2_26
134 # define SOUP_DEPRECATED_IN_2_26_FOR(f)
137 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_26
138 # define SOUP_AVAILABLE_IN_2_26 G_UNAVAILABLE(2, 26) _SOUP_EXTERN
140 # define SOUP_AVAILABLE_IN_2_26 _SOUP_EXTERN
143 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_28
144 # define SOUP_DEPRECATED_IN_2_28 G_DEPRECATED
145 # define SOUP_DEPRECATED_IN_2_28_FOR(f) G_DEPRECATED_FOR(f)
147 # define SOUP_DEPRECATED_IN_2_28
148 # define SOUP_DEPRECATED_IN_2_28_FOR(f)
151 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_28
152 # define SOUP_AVAILABLE_IN_2_28 G_UNAVAILABLE(2, 28) _SOUP_EXTERN
154 # define SOUP_AVAILABLE_IN_2_28 _SOUP_EXTERN
157 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_30
158 # define SOUP_DEPRECATED_IN_2_30 G_DEPRECATED
159 # define SOUP_DEPRECATED_IN_2_30_FOR(f) G_DEPRECATED_FOR(f)
161 # define SOUP_DEPRECATED_IN_2_30
162 # define SOUP_DEPRECATED_IN_2_30_FOR(f)
165 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_30
166 # define SOUP_AVAILABLE_IN_2_30 G_UNAVAILABLE(2, 30) _SOUP_EXTERN
168 # define SOUP_AVAILABLE_IN_2_30 _SOUP_EXTERN
171 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_32
172 # define SOUP_DEPRECATED_IN_2_32 G_DEPRECATED
173 # define SOUP_DEPRECATED_IN_2_32_FOR(f) G_DEPRECATED_FOR(f)
175 # define SOUP_DEPRECATED_IN_2_32
176 # define SOUP_DEPRECATED_IN_2_32_FOR(f)
179 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_32
180 # define SOUP_AVAILABLE_IN_2_32 G_UNAVAILABLE(2, 32) _SOUP_EXTERN
182 # define SOUP_AVAILABLE_IN_2_32 _SOUP_EXTERN
185 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_34
186 # define SOUP_DEPRECATED_IN_2_34 G_DEPRECATED
187 # define SOUP_DEPRECATED_IN_2_34_FOR(f) G_DEPRECATED_FOR(f)
189 # define SOUP_DEPRECATED_IN_2_34
190 # define SOUP_DEPRECATED_IN_2_34_FOR(f)
193 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_34
194 # define SOUP_AVAILABLE_IN_2_34 G_UNAVAILABLE(2, 34) _SOUP_EXTERN
196 # define SOUP_AVAILABLE_IN_2_34 _SOUP_EXTERN
199 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_36
200 # define SOUP_DEPRECATED_IN_2_36 G_DEPRECATED
201 # define SOUP_DEPRECATED_IN_2_36_FOR(f) G_DEPRECATED_FOR(f)
203 # define SOUP_DEPRECATED_IN_2_36
204 # define SOUP_DEPRECATED_IN_2_36_FOR(f)
207 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_36
208 # define SOUP_AVAILABLE_IN_2_36 G_UNAVAILABLE(2, 36) _SOUP_EXTERN
210 # define SOUP_AVAILABLE_IN_2_36 _SOUP_EXTERN
213 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_38
214 # define SOUP_DEPRECATED_IN_2_38 G_DEPRECATED
215 # define SOUP_DEPRECATED_IN_2_38_FOR(f) G_DEPRECATED_FOR(f)
217 # define SOUP_DEPRECATED_IN_2_38
218 # define SOUP_DEPRECATED_IN_2_38_FOR(f)
221 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_38
222 # define SOUP_AVAILABLE_IN_2_38 G_UNAVAILABLE(2, 38) _SOUP_EXTERN
224 # define SOUP_AVAILABLE_IN_2_38 _SOUP_EXTERN
227 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_40
228 # define SOUP_DEPRECATED_IN_2_40 G_DEPRECATED
229 # define SOUP_DEPRECATED_IN_2_40_FOR(f) G_DEPRECATED_FOR(f)
231 # define SOUP_DEPRECATED_IN_2_40
232 # define SOUP_DEPRECATED_IN_2_40_FOR(f)
235 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_40
236 # define SOUP_AVAILABLE_IN_2_40 G_UNAVAILABLE(2, 40) _SOUP_EXTERN
238 # define SOUP_AVAILABLE_IN_2_40 _SOUP_EXTERN
241 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_42
242 # define SOUP_DEPRECATED_IN_2_42 G_DEPRECATED
243 # define SOUP_DEPRECATED_IN_2_42_FOR(f) G_DEPRECATED_FOR(f)
245 # define SOUP_DEPRECATED_IN_2_42
246 # define SOUP_DEPRECATED_IN_2_42_FOR(f)
249 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_42
250 # define SOUP_AVAILABLE_IN_2_42 G_UNAVAILABLE(2, 42) _SOUP_EXTERN
252 # define SOUP_AVAILABLE_IN_2_42 _SOUP_EXTERN
255 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_44
256 # define SOUP_DEPRECATED_IN_2_44 G_DEPRECATED
257 # define SOUP_DEPRECATED_IN_2_44_FOR(f) G_DEPRECATED_FOR(f)
259 # define SOUP_DEPRECATED_IN_2_44
260 # define SOUP_DEPRECATED_IN_2_44_FOR(f)
263 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_44
264 # define SOUP_AVAILABLE_IN_2_44 G_UNAVAILABLE(2, 44) _SOUP_EXTERN
266 # define SOUP_AVAILABLE_IN_2_44 _SOUP_EXTERN
269 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_46
270 # define SOUP_DEPRECATED_IN_2_46 G_DEPRECATED
271 # define SOUP_DEPRECATED_IN_2_46_FOR(f) G_DEPRECATED_FOR(f)
273 # define SOUP_DEPRECATED_IN_2_46
274 # define SOUP_DEPRECATED_IN_2_46_FOR(f)
277 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_46
278 # define SOUP_AVAILABLE_IN_2_46 G_UNAVAILABLE(2, 46) _SOUP_EXTERN
280 # define SOUP_AVAILABLE_IN_2_46 _SOUP_EXTERN
283 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_48
284 # define SOUP_DEPRECATED_IN_2_48 G_DEPRECATED
285 # define SOUP_DEPRECATED_IN_2_48_FOR(f) G_DEPRECATED_FOR(f)
287 # define SOUP_DEPRECATED_IN_2_48
288 # define SOUP_DEPRECATED_IN_2_48_FOR(f)
291 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_48
292 # define SOUP_AVAILABLE_IN_2_48 G_UNAVAILABLE(2, 48) _SOUP_EXTERN
294 # define SOUP_AVAILABLE_IN_2_48 _SOUP_EXTERN
297 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_50
298 # define SOUP_DEPRECATED_IN_2_50 G_DEPRECATED
299 # define SOUP_DEPRECATED_IN_2_50_FOR(f) G_DEPRECATED_FOR(f)
301 # define SOUP_DEPRECATED_IN_2_50
302 # define SOUP_DEPRECATED_IN_2_50_FOR(f)
305 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_50
306 # define SOUP_AVAILABLE_IN_2_50 G_UNAVAILABLE(2, 50) _SOUP_EXTERN
308 # define SOUP_AVAILABLE_IN_2_50 _SOUP_EXTERN
311 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_52
312 # define SOUP_DEPRECATED_IN_2_52 G_DEPRECATED
313 # define SOUP_DEPRECATED_IN_2_52_FOR(f) G_DEPRECATED_FOR(f)
315 # define SOUP_DEPRECATED_IN_2_52
316 # define SOUP_DEPRECATED_IN_2_52_FOR(f)
319 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_52
320 # define SOUP_AVAILABLE_IN_2_52 G_UNAVAILABLE(2, 52) _SOUP_EXTERN
322 # define SOUP_AVAILABLE_IN_2_52 _SOUP_EXTERN
325 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_54
326 # define SOUP_DEPRECATED_IN_2_54 G_DEPRECATED
327 # define SOUP_DEPRECATED_IN_2_54_FOR(f) G_DEPRECATED_FOR(f)
329 # define SOUP_DEPRECATED_IN_2_54
330 # define SOUP_DEPRECATED_IN_2_54_FOR(f)
333 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_54
334 # define SOUP_AVAILABLE_IN_2_54 G_UNAVAILABLE(2, 54) _SOUP_EXTERN
336 # define SOUP_AVAILABLE_IN_2_54 _SOUP_EXTERN
339 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_56
340 # define SOUP_DEPRECATED_IN_2_56 G_DEPRECATED
341 # define SOUP_DEPRECATED_IN_2_56_FOR(f) G_DEPRECATED_FOR(f)
343 # define SOUP_DEPRECATED_IN_2_56
344 # define SOUP_DEPRECATED_IN_2_56_FOR(f)
347 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_56
348 # define SOUP_AVAILABLE_IN_2_56 G_UNAVAILABLE(2, 56) _SOUP_EXTERN
350 # define SOUP_AVAILABLE_IN_2_56 _SOUP_EXTERN
353 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_58
354 # define SOUP_DEPRECATED_IN_2_58 G_DEPRECATED
355 # define SOUP_DEPRECATED_IN_2_58_FOR(f) G_DEPRECATED_FOR(f)
357 # define SOUP_DEPRECATED_IN_2_58
358 # define SOUP_DEPRECATED_IN_2_58_FOR(f)
361 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_58
362 # define SOUP_AVAILABLE_IN_2_58 G_UNAVAILABLE(2, 58) _SOUP_EXTERN
364 # define SOUP_AVAILABLE_IN_2_58 _SOUP_EXTERN
367 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_62
368 # define SOUP_DEPRECATED_IN_2_62 G_DEPRECATED
369 # define SOUP_DEPRECATED_IN_2_62_FOR(f) G_DEPRECATED_FOR(f)
371 # define SOUP_DEPRECATED_IN_2_62
372 # define SOUP_DEPRECATED_IN_2_62_FOR(f)
375 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_62
376 # define SOUP_AVAILABLE_IN_2_62 G_UNAVAILABLE(2, 62) _SOUP_EXTERN
378 # define SOUP_AVAILABLE_IN_2_62 _SOUP_EXTERN
381 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_66
382 # define SOUP_DEPRECATED_IN_2_66 G_DEPRECATED
383 # define SOUP_DEPRECATED_IN_2_66_FOR(f) G_DEPRECATED_FOR(f)
385 # define SOUP_DEPRECATED_IN_2_66
386 # define SOUP_DEPRECATED_IN_2_66_FOR(f)
389 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_66
390 # define SOUP_AVAILABLE_IN_2_66 G_UNAVAILABLE(2, 66) _SOUP_EXTERN
392 # define SOUP_AVAILABLE_IN_2_66 _SOUP_EXTERN
395 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_68
396 # define SOUP_AVAILABLE_IN_2_68 G_UNAVAILABLE(2, 68) _SOUP_EXTERN
398 # define SOUP_AVAILABLE_IN_2_68 _SOUP_EXTERN
401 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_70
402 # define SOUP_DEPRECATED_IN_2_70 G_DEPRECATED
403 # define SOUP_DEPRECATED_IN_2_70_FOR(f) G_DEPRECATED_FOR(f)
405 # define SOUP_DEPRECATED_IN_2_70
406 # define SOUP_DEPRECATED_IN_2_70_FOR(f)
409 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_70
410 # define SOUP_AVAILABLE_IN_2_70 G_UNAVAILABLE(2, 70) _SOUP_EXTERN
412 # define SOUP_AVAILABLE_IN_2_70 _SOUP_EXTERN
415 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_72
416 # define SOUP_AVAILABLE_IN_2_72 G_UNAVAILABLE(2, 72) _SOUP_EXTERN
418 # define SOUP_AVAILABLE_IN_2_72 _SOUP_EXTERN
421 SOUP_AVAILABLE_IN_2_42
422 guint soup_get_major_version (void);
424 SOUP_AVAILABLE_IN_2_42
425 guint soup_get_minor_version (void);
427 SOUP_AVAILABLE_IN_2_42
428 guint soup_get_micro_version (void);
430 SOUP_AVAILABLE_IN_2_42
431 gboolean soup_check_version (guint major,
437 #endif /* __SOUP_VERSION_H__ */