Add some more cases to the app-id unit tests
[glib.git] / glib / gversionmacros.h
blobcbbb4a7ec605692230eb0f32c838677e9e8960c1
1 /* GLIB - Library of useful routines for C programming
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 * Modified by the GLib Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GLib Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GLib at ftp://ftp.gtk.org/pub/gtk/.
25 #ifndef __G_VERSION_MACROS_H__
26 #define __G_VERSION_MACROS_H__
28 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
29 #error "Only <glib.h> can be included directly."
30 #endif
32 /* Version boundaries checks */
34 #define G_ENCODE_VERSION(major,minor) ((major) << 16 | (minor) << 8)
36 /* XXX: Every new stable minor release bump should add a macro here */
38 /**
39 * GLIB_VERSION_2_26:
41 * A macro that evaluates to the 2.26 version of GLib, in a format
42 * that can be used by the C pre-processor.
44 * Since: 2.32
46 #define GLIB_VERSION_2_26 (G_ENCODE_VERSION (2, 26))
48 /**
49 * GLIB_VERSION_2_28:
51 * A macro that evaluates to the 2.28 version of GLib, in a format
52 * that can be used by the C pre-processor.
54 * Since: 2.32
56 #define GLIB_VERSION_2_28 (G_ENCODE_VERSION (2, 28))
58 /**
59 * GLIB_VERSION_2_30:
61 * A macro that evaluates to the 2.30 version of GLib, in a format
62 * that can be used by the C pre-processor.
64 * Since: 2.32
66 #define GLIB_VERSION_2_30 (G_ENCODE_VERSION (2, 30))
68 /**
69 * GLIB_VERSION_2_32:
71 * A macro that evaluates to the 2.32 version of GLib, in a format
72 * that can be used by the C pre-processor.
74 * Since: 2.32
76 #define GLIB_VERSION_2_32 (G_ENCODE_VERSION (2, 32))
78 /**
79 * GLIB_VERSION_2_34:
81 * A macro that evaluates to the 2.34 version of GLib, in a format
82 * that can be used by the C pre-processor.
84 * Since: 2.34
86 #define GLIB_VERSION_2_34 (G_ENCODE_VERSION (2, 34))
88 /**
89 * GLIB_VERSION_2_36:
91 * A macro that evaluates to the 2.36 version of GLib, in a format
92 * that can be used by the C pre-processor.
94 * Since: 2.36
96 #define GLIB_VERSION_2_36 (G_ENCODE_VERSION (2, 36))
98 /**
99 * GLIB_VERSION_2_38:
101 * A macro that evaluates to the 2.38 version of GLib, in a format
102 * that can be used by the C pre-processor.
104 * Since: 2.38
106 #define GLIB_VERSION_2_38 (G_ENCODE_VERSION (2, 38))
109 * GLIB_VERSION_2_40:
111 * A macro that evaluates to the 2.40 version of GLib, in a format
112 * that can be used by the C pre-processor.
114 * Since: 2.40
116 #define GLIB_VERSION_2_40 (G_ENCODE_VERSION (2, 40))
119 * GLIB_VERSION_2_42:
121 * A macro that evaluates to the 2.42 version of GLib, in a format
122 * that can be used by the C pre-processor.
124 * Since: 2.42
126 #define GLIB_VERSION_2_42 (G_ENCODE_VERSION (2, 42))
129 * GLIB_VERSION_2_44:
131 * A macro that evaluates to the 2.44 version of GLib, in a format
132 * that can be used by the C pre-processor.
134 * Since: 2.44
136 #define GLIB_VERSION_2_44 (G_ENCODE_VERSION (2, 44))
139 * GLIB_VERSION_2_46:
141 * A macro that evaluates to the 2.46 version of GLib, in a format
142 * that can be used by the C pre-processor.
144 * Since: 2.46
146 #define GLIB_VERSION_2_46 (G_ENCODE_VERSION (2, 46))
149 * GLIB_VERSION_2_48:
151 * A macro that evaluates to the 2.48 version of GLib, in a format
152 * that can be used by the C pre-processor.
154 * Since: 2.48
156 #define GLIB_VERSION_2_48 (G_ENCODE_VERSION (2, 48))
159 * GLIB_VERSION_2_50:
161 * A macro that evaluates to the 2.50 version of GLib, in a format
162 * that can be used by the C pre-processor.
164 * Since: 2.50
166 #define GLIB_VERSION_2_50 (G_ENCODE_VERSION (2, 50))
169 * GLIB_VERSION_2_52:
171 * A macro that evaluates to the 2.52 version of GLib, in a format
172 * that can be used by the C pre-processor.
174 * Since: 2.52
176 #define GLIB_VERSION_2_52 (G_ENCODE_VERSION (2, 52))
178 /* evaluates to the current stable version; for development cycles,
179 * this means the next stable target
181 #if (GLIB_MINOR_VERSION % 2)
182 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1))
183 #else
184 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION))
185 #endif
187 /* evaluates to the previous stable version */
188 #if (GLIB_MINOR_VERSION % 2)
189 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1))
190 #else
191 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2))
192 #endif
195 * GLIB_VERSION_MIN_REQUIRED:
197 * A macro that should be defined by the user prior to including
198 * the glib.h header.
199 * The definition should be one of the predefined GLib version
200 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
202 * This macro defines the earliest version of GLib that the package is
203 * required to be able to compile against.
205 * If the compiler is configured to warn about the use of deprecated
206 * functions, then using functions that were deprecated in version
207 * %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but
208 * using functions deprecated in later releases will not).
210 * Since: 2.32
212 /* If the package sets GLIB_VERSION_MIN_REQUIRED to some future
213 * GLIB_VERSION_X_Y value that we don't know about, it will compare as
214 * 0 in preprocessor tests.
216 #ifndef GLIB_VERSION_MIN_REQUIRED
217 # define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE)
218 #elif GLIB_VERSION_MIN_REQUIRED == 0
219 # undef GLIB_VERSION_MIN_REQUIRED
220 # define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE + 2)
221 #endif
224 * GLIB_VERSION_MAX_ALLOWED:
226 * A macro that should be defined by the user prior to including
227 * the glib.h header.
228 * The definition should be one of the predefined GLib version
229 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
231 * This macro defines the latest version of the GLib API that the
232 * package is allowed to make use of.
234 * If the compiler is configured to warn about the use of deprecated
235 * functions, then using functions added after version
236 * %GLIB_VERSION_MAX_ALLOWED will cause warnings.
238 * Unless you are using GLIB_CHECK_VERSION() or the like to compile
239 * different code depending on the GLib version, then this should be
240 * set to the same value as %GLIB_VERSION_MIN_REQUIRED.
242 * Since: 2.32
244 #if !defined (GLIB_VERSION_MAX_ALLOWED) || (GLIB_VERSION_MAX_ALLOWED == 0)
245 # undef GLIB_VERSION_MAX_ALLOWED
246 # define GLIB_VERSION_MAX_ALLOWED (GLIB_VERSION_CUR_STABLE)
247 #endif
249 /* sanity checks */
250 #if GLIB_VERSION_MIN_REQUIRED > GLIB_VERSION_CUR_STABLE
251 #error "GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE"
252 #endif
253 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED
254 #error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED"
255 #endif
256 #if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_26
257 #error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
258 #endif
260 /* These macros are used to mark deprecated functions in GLib headers,
261 * and thus have to be exposed in installed headers. But please
262 * do *not* use them in other projects. Instead, use G_DEPRECATED
263 * or define your own wrappers around it.
265 #define GLIB_AVAILABLE_IN_ALL _GLIB_EXTERN
267 /* XXX: Every new stable minor release should add a set of macros here */
269 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_26
270 # define GLIB_DEPRECATED_IN_2_26 GLIB_DEPRECATED
271 # define GLIB_DEPRECATED_IN_2_26_FOR(f) GLIB_DEPRECATED_FOR(f)
272 #else
273 # define GLIB_DEPRECATED_IN_2_26 _GLIB_EXTERN
274 # define GLIB_DEPRECATED_IN_2_26_FOR(f) _GLIB_EXTERN
275 #endif
277 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_26
278 # define GLIB_AVAILABLE_IN_2_26 GLIB_UNAVAILABLE(2, 26)
279 #else
280 # define GLIB_AVAILABLE_IN_2_26 _GLIB_EXTERN
281 #endif
283 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_28
284 # define GLIB_DEPRECATED_IN_2_28 GLIB_DEPRECATED
285 # define GLIB_DEPRECATED_IN_2_28_FOR(f) GLIB_DEPRECATED_FOR(f)
286 #else
287 # define GLIB_DEPRECATED_IN_2_28 _GLIB_EXTERN
288 # define GLIB_DEPRECATED_IN_2_28_FOR(f) _GLIB_EXTERN
289 #endif
291 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_28
292 # define GLIB_AVAILABLE_IN_2_28 GLIB_UNAVAILABLE(2, 28)
293 #else
294 # define GLIB_AVAILABLE_IN_2_28 _GLIB_EXTERN
295 #endif
297 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_30
298 # define GLIB_DEPRECATED_IN_2_30 GLIB_DEPRECATED
299 # define GLIB_DEPRECATED_IN_2_30_FOR(f) GLIB_DEPRECATED_FOR(f)
300 #else
301 # define GLIB_DEPRECATED_IN_2_30 _GLIB_EXTERN
302 # define GLIB_DEPRECATED_IN_2_30_FOR(f) _GLIB_EXTERN
303 #endif
305 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_30
306 # define GLIB_AVAILABLE_IN_2_30 GLIB_UNAVAILABLE(2, 30)
307 #else
308 # define GLIB_AVAILABLE_IN_2_30 _GLIB_EXTERN
309 #endif
311 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32
312 # define GLIB_DEPRECATED_IN_2_32 GLIB_DEPRECATED
313 # define GLIB_DEPRECATED_IN_2_32_FOR(f) GLIB_DEPRECATED_FOR(f)
314 #else
315 # define GLIB_DEPRECATED_IN_2_32 _GLIB_EXTERN
316 # define GLIB_DEPRECATED_IN_2_32_FOR(f) _GLIB_EXTERN
317 #endif
319 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32
320 # define GLIB_AVAILABLE_IN_2_32 GLIB_UNAVAILABLE(2, 32)
321 #else
322 # define GLIB_AVAILABLE_IN_2_32 _GLIB_EXTERN
323 #endif
325 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34
326 # define GLIB_DEPRECATED_IN_2_34 GLIB_DEPRECATED
327 # define GLIB_DEPRECATED_IN_2_34_FOR(f) GLIB_DEPRECATED_FOR(f)
328 #else
329 # define GLIB_DEPRECATED_IN_2_34 _GLIB_EXTERN
330 # define GLIB_DEPRECATED_IN_2_34_FOR(f) _GLIB_EXTERN
331 #endif
333 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34
334 # define GLIB_AVAILABLE_IN_2_34 GLIB_UNAVAILABLE(2, 34)
335 #else
336 # define GLIB_AVAILABLE_IN_2_34 _GLIB_EXTERN
337 #endif
339 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_36
340 # define GLIB_DEPRECATED_IN_2_36 GLIB_DEPRECATED
341 # define GLIB_DEPRECATED_IN_2_36_FOR(f) GLIB_DEPRECATED_FOR(f)
342 #else
343 # define GLIB_DEPRECATED_IN_2_36 _GLIB_EXTERN
344 # define GLIB_DEPRECATED_IN_2_36_FOR(f) _GLIB_EXTERN
345 #endif
347 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_36
348 # define GLIB_AVAILABLE_IN_2_36 GLIB_UNAVAILABLE(2, 36)
349 #else
350 # define GLIB_AVAILABLE_IN_2_36 _GLIB_EXTERN
351 #endif
353 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_38
354 # define GLIB_DEPRECATED_IN_2_38 GLIB_DEPRECATED
355 # define GLIB_DEPRECATED_IN_2_38_FOR(f) GLIB_DEPRECATED_FOR(f)
356 #else
357 # define GLIB_DEPRECATED_IN_2_38 _GLIB_EXTERN
358 # define GLIB_DEPRECATED_IN_2_38_FOR(f) _GLIB_EXTERN
359 #endif
361 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
362 # define GLIB_AVAILABLE_IN_2_38 GLIB_UNAVAILABLE(2, 38)
363 #else
364 # define GLIB_AVAILABLE_IN_2_38 _GLIB_EXTERN
365 #endif
367 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_40
368 # define GLIB_DEPRECATED_IN_2_40 GLIB_DEPRECATED
369 # define GLIB_DEPRECATED_IN_2_40_FOR(f) GLIB_DEPRECATED_FOR(f)
370 #else
371 # define GLIB_DEPRECATED_IN_2_40 _GLIB_EXTERN
372 # define GLIB_DEPRECATED_IN_2_40_FOR(f) _GLIB_EXTERN
373 #endif
375 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_40
376 # define GLIB_AVAILABLE_IN_2_40 GLIB_UNAVAILABLE(2, 40)
377 #else
378 # define GLIB_AVAILABLE_IN_2_40 _GLIB_EXTERN
379 #endif
381 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_42
382 # define GLIB_DEPRECATED_IN_2_42 GLIB_DEPRECATED
383 # define GLIB_DEPRECATED_IN_2_42_FOR(f) GLIB_DEPRECATED_FOR(f)
384 #else
385 # define GLIB_DEPRECATED_IN_2_42 _GLIB_EXTERN
386 # define GLIB_DEPRECATED_IN_2_42_FOR(f) _GLIB_EXTERN
387 #endif
389 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_42
390 # define GLIB_AVAILABLE_IN_2_42 GLIB_UNAVAILABLE(2, 42)
391 #else
392 # define GLIB_AVAILABLE_IN_2_42 _GLIB_EXTERN
393 #endif
395 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_44
396 # define GLIB_DEPRECATED_IN_2_44 GLIB_DEPRECATED
397 # define GLIB_DEPRECATED_IN_2_44_FOR(f) GLIB_DEPRECATED_FOR(f)
398 #else
399 # define GLIB_DEPRECATED_IN_2_44 _GLIB_EXTERN
400 # define GLIB_DEPRECATED_IN_2_44_FOR(f) _GLIB_EXTERN
401 #endif
403 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_44
404 # define GLIB_AVAILABLE_IN_2_44 GLIB_UNAVAILABLE(2, 44)
405 #else
406 # define GLIB_AVAILABLE_IN_2_44 _GLIB_EXTERN
407 #endif
409 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_46
410 # define GLIB_DEPRECATED_IN_2_46 GLIB_DEPRECATED
411 # define GLIB_DEPRECATED_IN_2_46_FOR(f) GLIB_DEPRECATED_FOR(f)
412 #else
413 # define GLIB_DEPRECATED_IN_2_46 _GLIB_EXTERN
414 # define GLIB_DEPRECATED_IN_2_46_FOR(f) _GLIB_EXTERN
415 #endif
417 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_46
418 # define GLIB_AVAILABLE_IN_2_46 GLIB_UNAVAILABLE(2, 46)
419 #else
420 # define GLIB_AVAILABLE_IN_2_46 _GLIB_EXTERN
421 #endif
423 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_48
424 # define GLIB_DEPRECATED_IN_2_48 GLIB_DEPRECATED
425 # define GLIB_DEPRECATED_IN_2_48_FOR(f) GLIB_DEPRECATED_FOR(f)
426 #else
427 # define GLIB_DEPRECATED_IN_2_48 _GLIB_EXTERN
428 # define GLIB_DEPRECATED_IN_2_48_FOR(f) _GLIB_EXTERN
429 #endif
431 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_48
432 # define GLIB_AVAILABLE_IN_2_48 GLIB_UNAVAILABLE(2, 48)
433 #else
434 # define GLIB_AVAILABLE_IN_2_48 _GLIB_EXTERN
435 #endif
437 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_50
438 # define GLIB_DEPRECATED_IN_2_50 GLIB_DEPRECATED
439 # define GLIB_DEPRECATED_IN_2_50_FOR(f) GLIB_DEPRECATED_FOR(f)
440 #else
441 # define GLIB_DEPRECATED_IN_2_50 _GLIB_EXTERN
442 # define GLIB_DEPRECATED_IN_2_50_FOR(f) _GLIB_EXTERN
443 #endif
445 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_50
446 # define GLIB_AVAILABLE_IN_2_50 GLIB_UNAVAILABLE(2, 50)
447 #else
448 # define GLIB_AVAILABLE_IN_2_50 _GLIB_EXTERN
449 #endif
451 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_52
452 # define GLIB_DEPRECATED_IN_2_52 GLIB_DEPRECATED
453 # define GLIB_DEPRECATED_IN_2_52_FOR(f) GLIB_DEPRECATED_FOR(f)
454 #else
455 # define GLIB_DEPRECATED_IN_2_52 _GLIB_EXTERN
456 # define GLIB_DEPRECATED_IN_2_52_FOR(f) _GLIB_EXTERN
457 #endif
459 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_52
460 # define GLIB_AVAILABLE_IN_2_52 GLIB_UNAVAILABLE(2, 52)
461 #else
462 # define GLIB_AVAILABLE_IN_2_52 _GLIB_EXTERN
463 #endif
465 #endif /* __G_VERSION_MACROS_H__ */