Remove build warning
[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 #define SOUP_VERSION_2_46 (SOUP_ENCODE_VERSION (2, 46))
51
52 /* evaluates to the current stable version; for development cycles,
53  * this means the next stable target
54  */
55 #if (SOUP_MINOR_VERSION % 2)
56 #define SOUP_VERSION_CUR_STABLE (SOUP_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION + 1))
57 #else
58 #define SOUP_VERSION_CUR_STABLE (SOUP_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION))
59 #endif
60
61 /* evaluates to the previous stable version */
62 #if (SOUP_MINOR_VERSION % 2)
63 #define SOUP_VERSION_PREV_STABLE (SOUP_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION - 1))
64 #else
65 #define SOUP_VERSION_PREV_STABLE (SOUP_ENCODE_VERSION (SOUP_MAJOR_VERSION, SOUP_MINOR_VERSION - 2))
66 #endif
67
68 #ifndef SOUP_VERSION_MIN_REQUIRED
69 # define SOUP_VERSION_MIN_REQUIRED (SOUP_VERSION_CUR_STABLE)
70 #elif SOUP_VERSION_MIN_REQUIRED == 0
71 # undef  SOUP_VERSION_MIN_REQUIRED
72 # define SOUP_VERSION_MIN_REQUIRED (SOUP_VERSION_CUR_STABLE + 2)
73 #endif
74
75 #if !defined (SOUP_VERSION_MAX_ALLOWED) || (SOUP_VERSION_MAX_ALLOWED == 0)
76 # undef SOUP_VERSION_MAX_ALLOWED
77 # define SOUP_VERSION_MAX_ALLOWED (SOUP_VERSION_CUR_STABLE)
78 #endif
79
80 /* sanity checks */
81 #if SOUP_VERSION_MIN_REQUIRED > SOUP_VERSION_CUR_STABLE
82 #error "SOUP_VERSION_MIN_REQUIRED must be <= SOUP_VERSION_CUR_STABLE"
83 #endif
84 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_MIN_REQUIRED
85 #error "SOUP_VERSION_MAX_ALLOWED must be >= SOUP_VERSION_MIN_REQUIRED"
86 #endif
87 #if SOUP_VERSION_MIN_REQUIRED < SOUP_VERSION_2_24
88 #error "SOUP_VERSION_MIN_REQUIRED must be >= SOUP_VERSION_2_24"
89 #endif
90
91 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_24
92 # define SOUP_DEPRECATED_IN_2_24                GLIB_DEPRECATED
93 # define SOUP_DEPRECATED_IN_2_24_FOR(f)         GLIB_DEPRECATED_FOR(f)
94 #else
95 # define SOUP_DEPRECATED_IN_2_24
96 # define SOUP_DEPRECATED_IN_2_24_FOR(f)
97 #endif
98
99 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_24
100 # define SOUP_AVAILABLE_IN_2_24                 GLIB_UNAVAILABLE(2, 24)
101 #else
102 # define SOUP_AVAILABLE_IN_2_24
103 #endif
104
105 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_26
106 # define SOUP_DEPRECATED_IN_2_26                GLIB_DEPRECATED
107 # define SOUP_DEPRECATED_IN_2_26_FOR(f)         GLIB_DEPRECATED_FOR(f)
108 #else
109 # define SOUP_DEPRECATED_IN_2_26
110 # define SOUP_DEPRECATED_IN_2_26_FOR(f)
111 #endif
112
113 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_26
114 # define SOUP_AVAILABLE_IN_2_26                 GLIB_UNAVAILABLE(2, 26)
115 #else
116 # define SOUP_AVAILABLE_IN_2_26
117 #endif
118
119 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_28
120 # define SOUP_DEPRECATED_IN_2_28                GLIB_DEPRECATED
121 # define SOUP_DEPRECATED_IN_2_28_FOR(f)         GLIB_DEPRECATED_FOR(f)
122 #else
123 # define SOUP_DEPRECATED_IN_2_28
124 # define SOUP_DEPRECATED_IN_2_28_FOR(f)
125 #endif
126
127 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_28
128 # define SOUP_AVAILABLE_IN_2_28                 GLIB_UNAVAILABLE(2, 28)
129 #else
130 # define SOUP_AVAILABLE_IN_2_28
131 #endif
132
133 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_30
134 # define SOUP_DEPRECATED_IN_2_30                GLIB_DEPRECATED
135 # define SOUP_DEPRECATED_IN_2_30_FOR(f)         GLIB_DEPRECATED_FOR(f)
136 #else
137 # define SOUP_DEPRECATED_IN_2_30
138 # define SOUP_DEPRECATED_IN_2_30_FOR(f)
139 #endif
140
141 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_30
142 # define SOUP_AVAILABLE_IN_2_30                 GLIB_UNAVAILABLE(2, 30)
143 #else
144 # define SOUP_AVAILABLE_IN_2_30
145 #endif
146
147 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_32
148 # define SOUP_DEPRECATED_IN_2_32                GLIB_DEPRECATED
149 # define SOUP_DEPRECATED_IN_2_32_FOR(f)         GLIB_DEPRECATED_FOR(f)
150 #else
151 # define SOUP_DEPRECATED_IN_2_32
152 # define SOUP_DEPRECATED_IN_2_32_FOR(f)
153 #endif
154
155 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_32
156 # define SOUP_AVAILABLE_IN_2_32                 GLIB_UNAVAILABLE(2, 32)
157 #else
158 # define SOUP_AVAILABLE_IN_2_32
159 #endif
160
161 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_34
162 # define SOUP_DEPRECATED_IN_2_34                GLIB_DEPRECATED
163 # define SOUP_DEPRECATED_IN_2_34_FOR(f)         GLIB_DEPRECATED_FOR(f)
164 #else
165 # define SOUP_DEPRECATED_IN_2_34
166 # define SOUP_DEPRECATED_IN_2_34_FOR(f)
167 #endif
168
169 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_34
170 # define SOUP_AVAILABLE_IN_2_34                 GLIB_UNAVAILABLE(2, 34)
171 #else
172 # define SOUP_AVAILABLE_IN_2_34
173 #endif
174
175 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_36
176 # define SOUP_DEPRECATED_IN_2_36                GLIB_DEPRECATED
177 # define SOUP_DEPRECATED_IN_2_36_FOR(f)         GLIB_DEPRECATED_FOR(f)
178 #else
179 # define SOUP_DEPRECATED_IN_2_36
180 # define SOUP_DEPRECATED_IN_2_36_FOR(f)
181 #endif
182
183 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_36
184 # define SOUP_AVAILABLE_IN_2_36                 GLIB_UNAVAILABLE(2, 36)
185 #else
186 # define SOUP_AVAILABLE_IN_2_36
187 #endif
188
189 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_38
190 # define SOUP_DEPRECATED_IN_2_38                GLIB_DEPRECATED
191 # define SOUP_DEPRECATED_IN_2_38_FOR(f)         GLIB_DEPRECATED_FOR(f)
192 #else
193 # define SOUP_DEPRECATED_IN_2_38
194 # define SOUP_DEPRECATED_IN_2_38_FOR(f)
195 #endif
196
197 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_38
198 # define SOUP_AVAILABLE_IN_2_38                 GLIB_UNAVAILABLE(2, 38)
199 #else
200 # define SOUP_AVAILABLE_IN_2_38
201 #endif
202
203 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_40
204 # define SOUP_DEPRECATED_IN_2_40                GLIB_DEPRECATED
205 # define SOUP_DEPRECATED_IN_2_40_FOR(f)         GLIB_DEPRECATED_FOR(f)
206 #else
207 # define SOUP_DEPRECATED_IN_2_40
208 # define SOUP_DEPRECATED_IN_2_40_FOR(f)
209 #endif
210
211 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_40
212 # define SOUP_AVAILABLE_IN_2_40                 GLIB_UNAVAILABLE(2, 40)
213 #else
214 # define SOUP_AVAILABLE_IN_2_40
215 #endif
216
217 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_42
218 # define SOUP_DEPRECATED_IN_2_42                GLIB_DEPRECATED
219 # define SOUP_DEPRECATED_IN_2_42_FOR(f)         GLIB_DEPRECATED_FOR(f)
220 #else
221 # define SOUP_DEPRECATED_IN_2_42
222 # define SOUP_DEPRECATED_IN_2_42_FOR(f)
223 #endif
224
225 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_42
226 # define SOUP_AVAILABLE_IN_2_42                 GLIB_UNAVAILABLE(2, 42)
227 #else
228 # define SOUP_AVAILABLE_IN_2_42
229 #endif
230
231 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_44
232 # define SOUP_DEPRECATED_IN_2_44                GLIB_DEPRECATED
233 # define SOUP_DEPRECATED_IN_2_44_FOR(f)         GLIB_DEPRECATED_FOR(f)
234 #else
235 # define SOUP_DEPRECATED_IN_2_44
236 # define SOUP_DEPRECATED_IN_2_44_FOR(f)
237 #endif
238
239 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_44
240 # define SOUP_AVAILABLE_IN_2_44                 GLIB_UNAVAILABLE(2, 44)
241 #else
242 # define SOUP_AVAILABLE_IN_2_44
243 #endif
244
245 #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_46
246 # define SOUP_DEPRECATED_IN_2_46                GLIB_DEPRECATED
247 # define SOUP_DEPRECATED_IN_2_46_FOR(f)         GLIB_DEPRECATED_FOR(f)
248 #else
249 # define SOUP_DEPRECATED_IN_2_46
250 # define SOUP_DEPRECATED_IN_2_46_FOR(f)
251 #endif
252
253 #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_46
254 # define SOUP_AVAILABLE_IN_2_46                 GLIB_UNAVAILABLE(2, 46)
255 #else
256 # define SOUP_AVAILABLE_IN_2_46
257 #endif
258
259 G_END_DECLS
260
261 #endif /* SOUP_VERSION_H */