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
13G_BEGIN_DECLS
14
15#define SOUP_MAJOR_VERSION (2)
16#define SOUP_MINOR_VERSION (66)
17#define SOUP_MICRO_VERSION (2)
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#ifndef _SOUP_EXTERN
26#define _SOUP_EXTERN extern
27#endif
28
29/* We prefix variable declarations so they can
30 * properly get exported in Windows DLLs.
31 */
32#ifndef SOUP_VAR
33# ifdef G_PLATFORM_WIN32
34# ifdef LIBSOUP_COMPILATION
35# ifdef DLL_EXPORT
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 */
46#endif /* SOUP_VAR */
47
48/* Deprecation / Availability macros */
49
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
71/* evaluates to the current stable version; for development cycles,
72 * this means the next stable target
73 */
74#if (SOUP_MINOR_VERSION % 2)
75#define SOUP_VERSION_CUR_STABLE (G_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION + 1))
76#else
77#define SOUP_VERSION_CUR_STABLE (G_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION))
78#endif
79
80/* evaluates to the previous stable version */
81#if (SOUP_MINOR_VERSION % 2)
82#define SOUP_VERSION_PREV_STABLE (G_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION - 1))
83#else
84#define SOUP_VERSION_PREV_STABLE (G_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION - 2))
85#endif
86
87#ifndef SOUP_VERSION_MIN_REQUIRED
88# define SOUP_VERSION_MIN_REQUIRED (SOUP_VERSION_CUR_STABLE)
89#elif SOUP_VERSION_MIN_REQUIRED == 0
90# undef SOUP_VERSION_MIN_REQUIRED
91# define SOUP_VERSION_MIN_REQUIRED (SOUP_VERSION_CUR_STABLE + 2)
92#endif
93
94#if !defined (SOUP_VERSION_MAX_ALLOWED) || (SOUP_VERSION_MAX_ALLOWED == 0)
95# undef SOUP_VERSION_MAX_ALLOWED
96# define SOUP_VERSION_MAX_ALLOWED (SOUP_VERSION_CUR_STABLE)
97#endif
98
99/* sanity checks */
100#if SOUP_VERSION_MIN_REQUIRED > SOUP_VERSION_CUR_STABLE
101#error "SOUP_VERSION_MIN_REQUIRED must be <= SOUP_VERSION_CUR_STABLE"
102#endif
103#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_MIN_REQUIRED
104#error "SOUP_VERSION_MAX_ALLOWED must be >= SOUP_VERSION_MIN_REQUIRED"
105#endif
106#if SOUP_VERSION_MIN_REQUIRED < SOUP_VERSION_2_24
107#error "SOUP_VERSION_MIN_REQUIRED must be >= SOUP_VERSION_2_24"
108#endif
109
110#define SOUP_AVAILABLE_IN_2_4 _SOUP_EXTERN
111
112#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_24
113# define SOUP_DEPRECATED_IN_2_24 G_DEPRECATED
114# define SOUP_DEPRECATED_IN_2_24_FOR(f) G_DEPRECATED_FOR(f)
115#else
116# define SOUP_DEPRECATED_IN_2_24
117# define SOUP_DEPRECATED_IN_2_24_FOR(f)
118#endif
119
120#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_24
121# define SOUP_AVAILABLE_IN_2_24 G_UNAVAILABLE(2, 24) _SOUP_EXTERN
122#else
123# define SOUP_AVAILABLE_IN_2_24 _SOUP_EXTERN
124#endif
125
126#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_26
127# define SOUP_DEPRECATED_IN_2_26 G_DEPRECATED
128# define SOUP_DEPRECATED_IN_2_26_FOR(f) G_DEPRECATED_FOR(f)
129#else
130# define SOUP_DEPRECATED_IN_2_26
131# define SOUP_DEPRECATED_IN_2_26_FOR(f)
132#endif
133
134#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_26
135# define SOUP_AVAILABLE_IN_2_26 G_UNAVAILABLE(2, 26) _SOUP_EXTERN
136#else
137# define SOUP_AVAILABLE_IN_2_26 _SOUP_EXTERN
138#endif
139
140#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_28
141# define SOUP_DEPRECATED_IN_2_28 G_DEPRECATED
142# define SOUP_DEPRECATED_IN_2_28_FOR(f) G_DEPRECATED_FOR(f)
143#else
144# define SOUP_DEPRECATED_IN_2_28
145# define SOUP_DEPRECATED_IN_2_28_FOR(f)
146#endif
147
148#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_28
149# define SOUP_AVAILABLE_IN_2_28 G_UNAVAILABLE(2, 28) _SOUP_EXTERN
150#else
151# define SOUP_AVAILABLE_IN_2_28 _SOUP_EXTERN
152#endif
153
154#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_30
155# define SOUP_DEPRECATED_IN_2_30 G_DEPRECATED
156# define SOUP_DEPRECATED_IN_2_30_FOR(f) G_DEPRECATED_FOR(f)
157#else
158# define SOUP_DEPRECATED_IN_2_30
159# define SOUP_DEPRECATED_IN_2_30_FOR(f)
160#endif
161
162#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_30
163# define SOUP_AVAILABLE_IN_2_30 G_UNAVAILABLE(2, 30) _SOUP_EXTERN
164#else
165# define SOUP_AVAILABLE_IN_2_30 _SOUP_EXTERN
166#endif
167
168#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_32
169# define SOUP_DEPRECATED_IN_2_32 G_DEPRECATED
170# define SOUP_DEPRECATED_IN_2_32_FOR(f) G_DEPRECATED_FOR(f)
171#else
172# define SOUP_DEPRECATED_IN_2_32
173# define SOUP_DEPRECATED_IN_2_32_FOR(f)
174#endif
175
176#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_32
177# define SOUP_AVAILABLE_IN_2_32 G_UNAVAILABLE(2, 32) _SOUP_EXTERN
178#else
179# define SOUP_AVAILABLE_IN_2_32 _SOUP_EXTERN
180#endif
181
182#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_34
183# define SOUP_DEPRECATED_IN_2_34 G_DEPRECATED
184# define SOUP_DEPRECATED_IN_2_34_FOR(f) G_DEPRECATED_FOR(f)
185#else
186# define SOUP_DEPRECATED_IN_2_34
187# define SOUP_DEPRECATED_IN_2_34_FOR(f)
188#endif
189
190#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_34
191# define SOUP_AVAILABLE_IN_2_34 G_UNAVAILABLE(2, 34) _SOUP_EXTERN
192#else
193# define SOUP_AVAILABLE_IN_2_34 _SOUP_EXTERN
194#endif
195
196#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_36
197# define SOUP_DEPRECATED_IN_2_36 G_DEPRECATED
198# define SOUP_DEPRECATED_IN_2_36_FOR(f) G_DEPRECATED_FOR(f)
199#else
200# define SOUP_DEPRECATED_IN_2_36
201# define SOUP_DEPRECATED_IN_2_36_FOR(f)
202#endif
203
204#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_36
205# define SOUP_AVAILABLE_IN_2_36 G_UNAVAILABLE(2, 36) _SOUP_EXTERN
206#else
207# define SOUP_AVAILABLE_IN_2_36 _SOUP_EXTERN
208#endif
209
210#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_38
211# define SOUP_DEPRECATED_IN_2_38 G_DEPRECATED
212# define SOUP_DEPRECATED_IN_2_38_FOR(f) G_DEPRECATED_FOR(f)
213#else
214# define SOUP_DEPRECATED_IN_2_38
215# define SOUP_DEPRECATED_IN_2_38_FOR(f)
216#endif
217
218#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_38
219# define SOUP_AVAILABLE_IN_2_38 G_UNAVAILABLE(2, 38) _SOUP_EXTERN
220#else
221# define SOUP_AVAILABLE_IN_2_38 _SOUP_EXTERN
222#endif
223
224#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_40
225# define SOUP_DEPRECATED_IN_2_40 G_DEPRECATED
226# define SOUP_DEPRECATED_IN_2_40_FOR(f) G_DEPRECATED_FOR(f)
227#else
228# define SOUP_DEPRECATED_IN_2_40
229# define SOUP_DEPRECATED_IN_2_40_FOR(f)
230#endif
231
232#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_40
233# define SOUP_AVAILABLE_IN_2_40 G_UNAVAILABLE(2, 40) _SOUP_EXTERN
234#else
235# define SOUP_AVAILABLE_IN_2_40 _SOUP_EXTERN
236#endif
237
238#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_42
239# define SOUP_DEPRECATED_IN_2_42 G_DEPRECATED
240# define SOUP_DEPRECATED_IN_2_42_FOR(f) G_DEPRECATED_FOR(f)
241#else
242# define SOUP_DEPRECATED_IN_2_42
243# define SOUP_DEPRECATED_IN_2_42_FOR(f)
244#endif
245
246#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_42
247# define SOUP_AVAILABLE_IN_2_42 G_UNAVAILABLE(2, 42) _SOUP_EXTERN
248#else
249# define SOUP_AVAILABLE_IN_2_42 _SOUP_EXTERN
250#endif
251
252#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_44
253# define SOUP_DEPRECATED_IN_2_44 G_DEPRECATED
254# define SOUP_DEPRECATED_IN_2_44_FOR(f) G_DEPRECATED_FOR(f)
255#else
256# define SOUP_DEPRECATED_IN_2_44
257# define SOUP_DEPRECATED_IN_2_44_FOR(f)
258#endif
259
260#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_44
261# define SOUP_AVAILABLE_IN_2_44 G_UNAVAILABLE(2, 44) _SOUP_EXTERN
262#else
263# define SOUP_AVAILABLE_IN_2_44 _SOUP_EXTERN
264#endif
265
266#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_46
267# define SOUP_DEPRECATED_IN_2_46 G_DEPRECATED
268# define SOUP_DEPRECATED_IN_2_46_FOR(f) G_DEPRECATED_FOR(f)
269#else
270# define SOUP_DEPRECATED_IN_2_46
271# define SOUP_DEPRECATED_IN_2_46_FOR(f)
272#endif
273
274#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_46
275# define SOUP_AVAILABLE_IN_2_46 G_UNAVAILABLE(2, 46) _SOUP_EXTERN
276#else
277# define SOUP_AVAILABLE_IN_2_46 _SOUP_EXTERN
278#endif
279
280#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_48
281# define SOUP_DEPRECATED_IN_2_48 G_DEPRECATED
282# define SOUP_DEPRECATED_IN_2_48_FOR(f) G_DEPRECATED_FOR(f)
283#else
284# define SOUP_DEPRECATED_IN_2_48
285# define SOUP_DEPRECATED_IN_2_48_FOR(f)
286#endif
287
288#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_48
289# define SOUP_AVAILABLE_IN_2_48 G_UNAVAILABLE(2, 48) _SOUP_EXTERN
290#else
291# define SOUP_AVAILABLE_IN_2_48 _SOUP_EXTERN
292#endif
293
294#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_50
295# define SOUP_DEPRECATED_IN_2_50 G_DEPRECATED
296# define SOUP_DEPRECATED_IN_2_50_FOR(f) G_DEPRECATED_FOR(f)
297#else
298# define SOUP_DEPRECATED_IN_2_50
299# define SOUP_DEPRECATED_IN_2_50_FOR(f)
300#endif
301
302#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_50
303# define SOUP_AVAILABLE_IN_2_50 G_UNAVAILABLE(2, 50) _SOUP_EXTERN
304#else
305# define SOUP_AVAILABLE_IN_2_50 _SOUP_EXTERN
306#endif
307
308#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_52
309# define SOUP_DEPRECATED_IN_2_52 G_DEPRECATED
310# define SOUP_DEPRECATED_IN_2_52_FOR(f) G_DEPRECATED_FOR(f)
311#else
312# define SOUP_DEPRECATED_IN_2_52
313# define SOUP_DEPRECATED_IN_2_52_FOR(f)
314#endif
315
316#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_52
317# define SOUP_AVAILABLE_IN_2_52 G_UNAVAILABLE(2, 52) _SOUP_EXTERN
318#else
319# define SOUP_AVAILABLE_IN_2_52 _SOUP_EXTERN
320#endif
321
322#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_54
323# define SOUP_DEPRECATED_IN_2_54 G_DEPRECATED
324# define SOUP_DEPRECATED_IN_2_54_FOR(f) G_DEPRECATED_FOR(f)
325#else
326# define SOUP_DEPRECATED_IN_2_54
327# define SOUP_DEPRECATED_IN_2_54_FOR(f)
328#endif
329
330#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_54
331# define SOUP_AVAILABLE_IN_2_54 G_UNAVAILABLE(2, 54) _SOUP_EXTERN
332#else
333# define SOUP_AVAILABLE_IN_2_54 _SOUP_EXTERN
334#endif
335
336#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_56
337# define SOUP_DEPRECATED_IN_2_56 G_DEPRECATED
338# define SOUP_DEPRECATED_IN_2_56_FOR(f) G_DEPRECATED_FOR(f)
339#else
340# define SOUP_DEPRECATED_IN_2_56
341# define SOUP_DEPRECATED_IN_2_56_FOR(f)
342#endif
343
344#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_56
345# define SOUP_AVAILABLE_IN_2_56 G_UNAVAILABLE(2, 56) _SOUP_EXTERN
346#else
347# define SOUP_AVAILABLE_IN_2_56 _SOUP_EXTERN
348#endif
349
350#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_58
351# define SOUP_DEPRECATED_IN_2_58 G_DEPRECATED
352# define SOUP_DEPRECATED_IN_2_58_FOR(f) G_DEPRECATED_FOR(f)
353#else
354# define SOUP_DEPRECATED_IN_2_58
355# define SOUP_DEPRECATED_IN_2_58_FOR(f)
356#endif
357
358#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_58
359# define SOUP_AVAILABLE_IN_2_58 G_UNAVAILABLE(2, 58) _SOUP_EXTERN
360#else
361# define SOUP_AVAILABLE_IN_2_58 _SOUP_EXTERN
362#endif
363
364#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_62
365# define SOUP_DEPRECATED_IN_2_62 G_DEPRECATED
366# define SOUP_DEPRECATED_IN_2_62_FOR(f) G_DEPRECATED_FOR(f)
367#else
368# define SOUP_DEPRECATED_IN_2_62
369# define SOUP_DEPRECATED_IN_2_62_FOR(f)
370#endif
371
372#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_62
373# define SOUP_AVAILABLE_IN_2_62 G_UNAVAILABLE(2, 62) _SOUP_EXTERN
374#else
375# define SOUP_AVAILABLE_IN_2_62 _SOUP_EXTERN
376#endif
377
378#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_66
379# define SOUP_DEPRECATED_IN_2_66 G_DEPRECATED
380# define SOUP_DEPRECATED_IN_2_66_FOR(f) G_DEPRECATED_FOR(f)
381#else
382# define SOUP_DEPRECATED_IN_2_66
383# define SOUP_DEPRECATED_IN_2_66_FOR(f)
384#endif
385
386#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_66
387# define SOUP_AVAILABLE_IN_2_66 G_UNAVAILABLE(2, 66) _SOUP_EXTERN
388#else
389# define SOUP_AVAILABLE_IN_2_66 _SOUP_EXTERN
390#endif
391
392SOUP_AVAILABLE_IN_2_42
393guint soup_get_major_version (void);
394
395SOUP_AVAILABLE_IN_2_42
396guint soup_get_minor_version (void);
397
398SOUP_AVAILABLE_IN_2_42
399guint soup_get_micro_version (void);
400
401SOUP_AVAILABLE_IN_2_42
402gboolean soup_check_version (guint major,
403 guint minor,
404 guint micro);
405
406G_END_DECLS
407
408#endif /* __SOUP_VERSION_H__ */
409