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.1 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."
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 */
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.
46 #define GLIB_VERSION_2_26 (G_ENCODE_VERSION (2, 26))
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.
56 #define GLIB_VERSION_2_28 (G_ENCODE_VERSION (2, 28))
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.
66 #define GLIB_VERSION_2_30 (G_ENCODE_VERSION (2, 30))
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.
76 #define GLIB_VERSION_2_32 (G_ENCODE_VERSION (2, 32))
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.
86 #define GLIB_VERSION_2_34 (G_ENCODE_VERSION (2, 34))
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.
96 #define GLIB_VERSION_2_36 (G_ENCODE_VERSION (2, 36))
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.
106 #define GLIB_VERSION_2_38 (G_ENCODE_VERSION (2, 38))
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.
116 #define GLIB_VERSION_2_40 (G_ENCODE_VERSION (2, 40))
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.
126 #define GLIB_VERSION_2_42 (G_ENCODE_VERSION (2, 42))
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.
136 #define GLIB_VERSION_2_44 (G_ENCODE_VERSION (2, 44))
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.
146 #define GLIB_VERSION_2_46 (G_ENCODE_VERSION (2, 46))
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.
156 #define GLIB_VERSION_2_48 (G_ENCODE_VERSION (2, 48))
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.
166 #define GLIB_VERSION_2_50 (G_ENCODE_VERSION (2, 50))
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.
176 #define GLIB_VERSION_2_52 (G_ENCODE_VERSION (2, 52))
181 * A macro that evaluates to the 2.54 version of GLib, in a format
182 * that can be used by the C pre-processor.
186 #define GLIB_VERSION_2_54 (G_ENCODE_VERSION (2, 54))
191 * A macro that evaluates to the 2.56 version of GLib, in a format
192 * that can be used by the C pre-processor.
196 #define GLIB_VERSION_2_56 (G_ENCODE_VERSION (2, 56))
201 * A macro that evaluates to the 2.58 version of GLib, in a format
202 * that can be used by the C pre-processor.
206 #define GLIB_VERSION_2_58 (G_ENCODE_VERSION (2, 58))
211 * A macro that evaluates to the 2.60 version of GLib, in a format
212 * that can be used by the C pre-processor.
216 #define GLIB_VERSION_2_60 (G_ENCODE_VERSION (2, 60))
218 /* evaluates to the current stable version; for development cycles,
219 * this means the next stable target
221 #if (GLIB_MINOR_VERSION % 2)
222 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1))
224 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION))
227 /* evaluates to the previous stable version */
228 #if (GLIB_MINOR_VERSION % 2)
229 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1))
231 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2))
235 * GLIB_VERSION_MIN_REQUIRED:
237 * A macro that should be defined by the user prior to including
239 * The definition should be one of the predefined GLib version
240 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
242 * This macro defines the earliest version of GLib that the package is
243 * required to be able to compile against.
245 * If the compiler is configured to warn about the use of deprecated
246 * functions, then using functions that were deprecated in version
247 * %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but
248 * using functions deprecated in later releases will not).
252 /* If the package sets GLIB_VERSION_MIN_REQUIRED to some future
253 * GLIB_VERSION_X_Y value that we don't know about, it will compare as
254 * 0 in preprocessor tests.
256 #ifndef GLIB_VERSION_MIN_REQUIRED
257 # define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE)
258 #elif GLIB_VERSION_MIN_REQUIRED == 0
259 # undef GLIB_VERSION_MIN_REQUIRED
260 # define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE + 2)
264 * GLIB_VERSION_MAX_ALLOWED:
266 * A macro that should be defined by the user prior to including
268 * The definition should be one of the predefined GLib version
269 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
271 * This macro defines the latest version of the GLib API that the
272 * package is allowed to make use of.
274 * If the compiler is configured to warn about the use of deprecated
275 * functions, then using functions added after version
276 * %GLIB_VERSION_MAX_ALLOWED will cause warnings.
278 * Unless you are using GLIB_CHECK_VERSION() or the like to compile
279 * different code depending on the GLib version, then this should be
280 * set to the same value as %GLIB_VERSION_MIN_REQUIRED.
284 #if !defined (GLIB_VERSION_MAX_ALLOWED) || (GLIB_VERSION_MAX_ALLOWED == 0)
285 # undef GLIB_VERSION_MAX_ALLOWED
286 # define GLIB_VERSION_MAX_ALLOWED (GLIB_VERSION_CUR_STABLE)
290 #if GLIB_VERSION_MIN_REQUIRED > GLIB_VERSION_CUR_STABLE
291 #error "GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE"
293 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED
294 #error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED"
296 #if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_26
297 #error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
300 /* These macros are used to mark deprecated functions in GLib headers,
301 * and thus have to be exposed in installed headers. But please
302 * do *not* use them in other projects. Instead, use G_DEPRECATED
303 * or define your own wrappers around it.
305 #define GLIB_AVAILABLE_IN_ALL _GLIB_EXTERN
307 /* XXX: Every new stable minor release should add a set of macros here */
309 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_26
310 # define GLIB_DEPRECATED_IN_2_26 GLIB_DEPRECATED
311 # define GLIB_DEPRECATED_IN_2_26_FOR(f) GLIB_DEPRECATED_FOR(f)
313 # define GLIB_DEPRECATED_IN_2_26 _GLIB_EXTERN
314 # define GLIB_DEPRECATED_IN_2_26_FOR(f) _GLIB_EXTERN
317 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_26
318 # define GLIB_AVAILABLE_IN_2_26 GLIB_UNAVAILABLE(2, 26)
320 # define GLIB_AVAILABLE_IN_2_26 _GLIB_EXTERN
323 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_28
324 # define GLIB_DEPRECATED_IN_2_28 GLIB_DEPRECATED
325 # define GLIB_DEPRECATED_IN_2_28_FOR(f) GLIB_DEPRECATED_FOR(f)
327 # define GLIB_DEPRECATED_IN_2_28 _GLIB_EXTERN
328 # define GLIB_DEPRECATED_IN_2_28_FOR(f) _GLIB_EXTERN
331 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_28
332 # define GLIB_AVAILABLE_IN_2_28 GLIB_UNAVAILABLE(2, 28)
334 # define GLIB_AVAILABLE_IN_2_28 _GLIB_EXTERN
337 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_30
338 # define GLIB_DEPRECATED_IN_2_30 GLIB_DEPRECATED
339 # define GLIB_DEPRECATED_IN_2_30_FOR(f) GLIB_DEPRECATED_FOR(f)
341 # define GLIB_DEPRECATED_IN_2_30 _GLIB_EXTERN
342 # define GLIB_DEPRECATED_IN_2_30_FOR(f) _GLIB_EXTERN
345 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_30
346 # define GLIB_AVAILABLE_IN_2_30 GLIB_UNAVAILABLE(2, 30)
348 # define GLIB_AVAILABLE_IN_2_30 _GLIB_EXTERN
351 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32
352 # define GLIB_DEPRECATED_IN_2_32 GLIB_DEPRECATED
353 # define GLIB_DEPRECATED_IN_2_32_FOR(f) GLIB_DEPRECATED_FOR(f)
355 # define GLIB_DEPRECATED_IN_2_32 _GLIB_EXTERN
356 # define GLIB_DEPRECATED_IN_2_32_FOR(f) _GLIB_EXTERN
359 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32
360 # define GLIB_AVAILABLE_IN_2_32 GLIB_UNAVAILABLE(2, 32)
362 # define GLIB_AVAILABLE_IN_2_32 _GLIB_EXTERN
365 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34
366 # define GLIB_DEPRECATED_IN_2_34 GLIB_DEPRECATED
367 # define GLIB_DEPRECATED_IN_2_34_FOR(f) GLIB_DEPRECATED_FOR(f)
369 # define GLIB_DEPRECATED_IN_2_34 _GLIB_EXTERN
370 # define GLIB_DEPRECATED_IN_2_34_FOR(f) _GLIB_EXTERN
373 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34
374 # define GLIB_AVAILABLE_IN_2_34 GLIB_UNAVAILABLE(2, 34)
376 # define GLIB_AVAILABLE_IN_2_34 _GLIB_EXTERN
379 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_36
380 # define GLIB_DEPRECATED_IN_2_36 GLIB_DEPRECATED
381 # define GLIB_DEPRECATED_IN_2_36_FOR(f) GLIB_DEPRECATED_FOR(f)
383 # define GLIB_DEPRECATED_IN_2_36 _GLIB_EXTERN
384 # define GLIB_DEPRECATED_IN_2_36_FOR(f) _GLIB_EXTERN
387 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_36
388 # define GLIB_AVAILABLE_IN_2_36 GLIB_UNAVAILABLE(2, 36)
390 # define GLIB_AVAILABLE_IN_2_36 _GLIB_EXTERN
393 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_38
394 # define GLIB_DEPRECATED_IN_2_38 GLIB_DEPRECATED
395 # define GLIB_DEPRECATED_IN_2_38_FOR(f) GLIB_DEPRECATED_FOR(f)
397 # define GLIB_DEPRECATED_IN_2_38 _GLIB_EXTERN
398 # define GLIB_DEPRECATED_IN_2_38_FOR(f) _GLIB_EXTERN
401 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
402 # define GLIB_AVAILABLE_IN_2_38 GLIB_UNAVAILABLE(2, 38)
404 # define GLIB_AVAILABLE_IN_2_38 _GLIB_EXTERN
407 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_40
408 # define GLIB_DEPRECATED_IN_2_40 GLIB_DEPRECATED
409 # define GLIB_DEPRECATED_IN_2_40_FOR(f) GLIB_DEPRECATED_FOR(f)
411 # define GLIB_DEPRECATED_IN_2_40 _GLIB_EXTERN
412 # define GLIB_DEPRECATED_IN_2_40_FOR(f) _GLIB_EXTERN
415 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_40
416 # define GLIB_AVAILABLE_IN_2_40 GLIB_UNAVAILABLE(2, 40)
418 # define GLIB_AVAILABLE_IN_2_40 _GLIB_EXTERN
421 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_42
422 # define GLIB_DEPRECATED_IN_2_42 GLIB_DEPRECATED
423 # define GLIB_DEPRECATED_IN_2_42_FOR(f) GLIB_DEPRECATED_FOR(f)
425 # define GLIB_DEPRECATED_IN_2_42 _GLIB_EXTERN
426 # define GLIB_DEPRECATED_IN_2_42_FOR(f) _GLIB_EXTERN
429 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_42
430 # define GLIB_AVAILABLE_IN_2_42 GLIB_UNAVAILABLE(2, 42)
432 # define GLIB_AVAILABLE_IN_2_42 _GLIB_EXTERN
435 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_44
436 # define GLIB_DEPRECATED_IN_2_44 GLIB_DEPRECATED
437 # define GLIB_DEPRECATED_IN_2_44_FOR(f) GLIB_DEPRECATED_FOR(f)
439 # define GLIB_DEPRECATED_IN_2_44 _GLIB_EXTERN
440 # define GLIB_DEPRECATED_IN_2_44_FOR(f) _GLIB_EXTERN
443 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_44
444 # define GLIB_AVAILABLE_IN_2_44 GLIB_UNAVAILABLE(2, 44)
446 # define GLIB_AVAILABLE_IN_2_44 _GLIB_EXTERN
449 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_46
450 # define GLIB_DEPRECATED_IN_2_46 GLIB_DEPRECATED
451 # define GLIB_DEPRECATED_IN_2_46_FOR(f) GLIB_DEPRECATED_FOR(f)
453 # define GLIB_DEPRECATED_IN_2_46 _GLIB_EXTERN
454 # define GLIB_DEPRECATED_IN_2_46_FOR(f) _GLIB_EXTERN
457 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_46
458 # define GLIB_AVAILABLE_IN_2_46 GLIB_UNAVAILABLE(2, 46)
460 # define GLIB_AVAILABLE_IN_2_46 _GLIB_EXTERN
463 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_48
464 # define GLIB_DEPRECATED_IN_2_48 GLIB_DEPRECATED
465 # define GLIB_DEPRECATED_IN_2_48_FOR(f) GLIB_DEPRECATED_FOR(f)
467 # define GLIB_DEPRECATED_IN_2_48 _GLIB_EXTERN
468 # define GLIB_DEPRECATED_IN_2_48_FOR(f) _GLIB_EXTERN
471 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_48
472 # define GLIB_AVAILABLE_IN_2_48 GLIB_UNAVAILABLE(2, 48)
474 # define GLIB_AVAILABLE_IN_2_48 _GLIB_EXTERN
477 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_50
478 # define GLIB_DEPRECATED_IN_2_50 GLIB_DEPRECATED
479 # define GLIB_DEPRECATED_IN_2_50_FOR(f) GLIB_DEPRECATED_FOR(f)
481 # define GLIB_DEPRECATED_IN_2_50 _GLIB_EXTERN
482 # define GLIB_DEPRECATED_IN_2_50_FOR(f) _GLIB_EXTERN
485 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_50
486 # define GLIB_AVAILABLE_IN_2_50 GLIB_UNAVAILABLE(2, 50)
488 # define GLIB_AVAILABLE_IN_2_50 _GLIB_EXTERN
491 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_52
492 # define GLIB_DEPRECATED_IN_2_52 GLIB_DEPRECATED
493 # define GLIB_DEPRECATED_IN_2_52_FOR(f) GLIB_DEPRECATED_FOR(f)
495 # define GLIB_DEPRECATED_IN_2_52 _GLIB_EXTERN
496 # define GLIB_DEPRECATED_IN_2_52_FOR(f) _GLIB_EXTERN
499 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_52
500 # define GLIB_AVAILABLE_IN_2_52 GLIB_UNAVAILABLE(2, 52)
502 # define GLIB_AVAILABLE_IN_2_52 _GLIB_EXTERN
505 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_54
506 # define GLIB_DEPRECATED_IN_2_54 GLIB_DEPRECATED
507 # define GLIB_DEPRECATED_IN_2_54_FOR(f) GLIB_DEPRECATED_FOR(f)
509 # define GLIB_DEPRECATED_IN_2_54 _GLIB_EXTERN
510 # define GLIB_DEPRECATED_IN_2_54_FOR(f) _GLIB_EXTERN
513 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_54
514 # define GLIB_AVAILABLE_IN_2_54 GLIB_UNAVAILABLE(2, 54)
516 # define GLIB_AVAILABLE_IN_2_54 _GLIB_EXTERN
519 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_56
520 # define GLIB_DEPRECATED_IN_2_56 GLIB_DEPRECATED
521 # define GLIB_DEPRECATED_IN_2_56_FOR(f) GLIB_DEPRECATED_FOR(f)
523 # define GLIB_DEPRECATED_IN_2_56 _GLIB_EXTERN
524 # define GLIB_DEPRECATED_IN_2_56_FOR(f) _GLIB_EXTERN
527 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_56
528 # define GLIB_AVAILABLE_IN_2_56 GLIB_UNAVAILABLE(2, 56)
530 # define GLIB_AVAILABLE_IN_2_56 _GLIB_EXTERN
533 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_58
534 # define GLIB_DEPRECATED_IN_2_58 GLIB_DEPRECATED
535 # define GLIB_DEPRECATED_IN_2_58_FOR(f) GLIB_DEPRECATED_FOR(f)
537 # define GLIB_DEPRECATED_IN_2_58 _GLIB_EXTERN
538 # define GLIB_DEPRECATED_IN_2_58_FOR(f) _GLIB_EXTERN
541 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_58
542 # define GLIB_AVAILABLE_IN_2_58 GLIB_UNAVAILABLE(2, 58)
544 # define GLIB_AVAILABLE_IN_2_58 _GLIB_EXTERN
547 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_60
548 # define GLIB_DEPRECATED_IN_2_60 GLIB_DEPRECATED
549 # define GLIB_DEPRECATED_IN_2_60_FOR(f) GLIB_DEPRECATED_FOR(f)
551 # define GLIB_DEPRECATED_IN_2_60 _GLIB_EXTERN
552 # define GLIB_DEPRECATED_IN_2_60_FOR(f) _GLIB_EXTERN
555 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_60
556 # define GLIB_AVAILABLE_IN_2_60 GLIB_UNAVAILABLE(2, 60)
558 # define GLIB_AVAILABLE_IN_2_60 _GLIB_EXTERN
561 #endif /* __G_VERSION_MACROS_H__ */