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."
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))
158 /* evaluates to the current stable version; for development cycles,
159 * this means the next stable target
161 #if (GLIB_MINOR_VERSION % 2)
162 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1))
164 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION))
167 /* evaluates to the previous stable version */
168 #if (GLIB_MINOR_VERSION % 2)
169 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1))
171 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2))
175 * GLIB_VERSION_MIN_REQUIRED:
177 * A macro that should be defined by the user prior to including
179 * The definition should be one of the predefined GLib version
180 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
182 * This macro defines the earliest version of GLib that the package is
183 * required to be able to compile against.
185 * If the compiler is configured to warn about the use of deprecated
186 * functions, then using functions that were deprecated in version
187 * %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but
188 * using functions deprecated in later releases will not).
192 /* If the package sets GLIB_VERSION_MIN_REQUIRED to some future
193 * GLIB_VERSION_X_Y value that we don't know about, it will compare as
194 * 0 in preprocessor tests.
196 #ifndef GLIB_VERSION_MIN_REQUIRED
197 # define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE)
198 #elif GLIB_VERSION_MIN_REQUIRED == 0
199 # undef GLIB_VERSION_MIN_REQUIRED
200 # define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE + 2)
204 * GLIB_VERSION_MAX_ALLOWED:
206 * A macro that should be defined by the user prior to including
208 * The definition should be one of the predefined GLib version
209 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
211 * This macro defines the latest version of the GLib API that the
212 * package is allowed to make use of.
214 * If the compiler is configured to warn about the use of deprecated
215 * functions, then using functions added after version
216 * %GLIB_VERSION_MAX_ALLOWED will cause warnings.
218 * Unless you are using GLIB_CHECK_VERSION() or the like to compile
219 * different code depending on the GLib version, then this should be
220 * set to the same value as %GLIB_VERSION_MIN_REQUIRED.
224 #if !defined (GLIB_VERSION_MAX_ALLOWED) || (GLIB_VERSION_MAX_ALLOWED == 0)
225 # undef GLIB_VERSION_MAX_ALLOWED
226 # define GLIB_VERSION_MAX_ALLOWED (GLIB_VERSION_CUR_STABLE)
230 #if GLIB_VERSION_MIN_REQUIRED > GLIB_VERSION_CUR_STABLE
231 #error "GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE"
233 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED
234 #error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED"
236 #if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_26
237 #error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
240 /* These macros are used to mark deprecated functions in GLib headers,
241 * and thus have to be exposed in installed headers. But please
242 * do *not* use them in other projects. Instead, use G_DEPRECATED
243 * or define your own wrappers around it.
245 #define GLIB_AVAILABLE_IN_ALL _GLIB_EXTERN
247 /* XXX: Every new stable minor release should add a set of macros here */
249 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_26
250 # define GLIB_DEPRECATED_IN_2_26 GLIB_DEPRECATED
251 # define GLIB_DEPRECATED_IN_2_26_FOR(f) GLIB_DEPRECATED_FOR(f)
253 # define GLIB_DEPRECATED_IN_2_26 _GLIB_EXTERN
254 # define GLIB_DEPRECATED_IN_2_26_FOR(f) _GLIB_EXTERN
257 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_26
258 # define GLIB_AVAILABLE_IN_2_26 GLIB_UNAVAILABLE(2, 26)
260 # define GLIB_AVAILABLE_IN_2_26 _GLIB_EXTERN
263 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_28
264 # define GLIB_DEPRECATED_IN_2_28 GLIB_DEPRECATED
265 # define GLIB_DEPRECATED_IN_2_28_FOR(f) GLIB_DEPRECATED_FOR(f)
267 # define GLIB_DEPRECATED_IN_2_28 _GLIB_EXTERN
268 # define GLIB_DEPRECATED_IN_2_28_FOR(f) _GLIB_EXTERN
271 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_28
272 # define GLIB_AVAILABLE_IN_2_28 GLIB_UNAVAILABLE(2, 28)
274 # define GLIB_AVAILABLE_IN_2_28 _GLIB_EXTERN
277 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_30
278 # define GLIB_DEPRECATED_IN_2_30 GLIB_DEPRECATED
279 # define GLIB_DEPRECATED_IN_2_30_FOR(f) GLIB_DEPRECATED_FOR(f)
281 # define GLIB_DEPRECATED_IN_2_30 _GLIB_EXTERN
282 # define GLIB_DEPRECATED_IN_2_30_FOR(f) _GLIB_EXTERN
285 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_30
286 # define GLIB_AVAILABLE_IN_2_30 GLIB_UNAVAILABLE(2, 30)
288 # define GLIB_AVAILABLE_IN_2_30 _GLIB_EXTERN
291 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32
292 # define GLIB_DEPRECATED_IN_2_32 GLIB_DEPRECATED
293 # define GLIB_DEPRECATED_IN_2_32_FOR(f) GLIB_DEPRECATED_FOR(f)
295 # define GLIB_DEPRECATED_IN_2_32 _GLIB_EXTERN
296 # define GLIB_DEPRECATED_IN_2_32_FOR(f) _GLIB_EXTERN
299 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32
300 # define GLIB_AVAILABLE_IN_2_32 GLIB_UNAVAILABLE(2, 32)
302 # define GLIB_AVAILABLE_IN_2_32 _GLIB_EXTERN
305 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34
306 # define GLIB_DEPRECATED_IN_2_34 GLIB_DEPRECATED
307 # define GLIB_DEPRECATED_IN_2_34_FOR(f) GLIB_DEPRECATED_FOR(f)
309 # define GLIB_DEPRECATED_IN_2_34 _GLIB_EXTERN
310 # define GLIB_DEPRECATED_IN_2_34_FOR(f) _GLIB_EXTERN
313 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34
314 # define GLIB_AVAILABLE_IN_2_34 GLIB_UNAVAILABLE(2, 34)
316 # define GLIB_AVAILABLE_IN_2_34 _GLIB_EXTERN
319 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_36
320 # define GLIB_DEPRECATED_IN_2_36 GLIB_DEPRECATED
321 # define GLIB_DEPRECATED_IN_2_36_FOR(f) GLIB_DEPRECATED_FOR(f)
323 # define GLIB_DEPRECATED_IN_2_36 _GLIB_EXTERN
324 # define GLIB_DEPRECATED_IN_2_36_FOR(f) _GLIB_EXTERN
327 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_36
328 # define GLIB_AVAILABLE_IN_2_36 GLIB_UNAVAILABLE(2, 36)
330 # define GLIB_AVAILABLE_IN_2_36 _GLIB_EXTERN
333 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_38
334 # define GLIB_DEPRECATED_IN_2_38 GLIB_DEPRECATED
335 # define GLIB_DEPRECATED_IN_2_38_FOR(f) GLIB_DEPRECATED_FOR(f)
337 # define GLIB_DEPRECATED_IN_2_38 _GLIB_EXTERN
338 # define GLIB_DEPRECATED_IN_2_38_FOR(f) _GLIB_EXTERN
341 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
342 # define GLIB_AVAILABLE_IN_2_38 GLIB_UNAVAILABLE(2, 38)
344 # define GLIB_AVAILABLE_IN_2_38 _GLIB_EXTERN
347 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_40
348 # define GLIB_DEPRECATED_IN_2_40 GLIB_DEPRECATED
349 # define GLIB_DEPRECATED_IN_2_40_FOR(f) GLIB_DEPRECATED_FOR(f)
351 # define GLIB_DEPRECATED_IN_2_40 _GLIB_EXTERN
352 # define GLIB_DEPRECATED_IN_2_40_FOR(f) _GLIB_EXTERN
355 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_40
356 # define GLIB_AVAILABLE_IN_2_40 GLIB_UNAVAILABLE(2, 40)
358 # define GLIB_AVAILABLE_IN_2_40 _GLIB_EXTERN
361 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_42
362 # define GLIB_DEPRECATED_IN_2_42 GLIB_DEPRECATED
363 # define GLIB_DEPRECATED_IN_2_42_FOR(f) GLIB_DEPRECATED_FOR(f)
365 # define GLIB_DEPRECATED_IN_2_42 _GLIB_EXTERN
366 # define GLIB_DEPRECATED_IN_2_42_FOR(f) _GLIB_EXTERN
369 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_42
370 # define GLIB_AVAILABLE_IN_2_42 GLIB_UNAVAILABLE(2, 42)
372 # define GLIB_AVAILABLE_IN_2_42 _GLIB_EXTERN
375 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_44
376 # define GLIB_DEPRECATED_IN_2_44 GLIB_DEPRECATED
377 # define GLIB_DEPRECATED_IN_2_44_FOR(f) GLIB_DEPRECATED_FOR(f)
379 # define GLIB_DEPRECATED_IN_2_44 _GLIB_EXTERN
380 # define GLIB_DEPRECATED_IN_2_44_FOR(f) _GLIB_EXTERN
383 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_44
384 # define GLIB_AVAILABLE_IN_2_44 GLIB_UNAVAILABLE(2, 44)
386 # define GLIB_AVAILABLE_IN_2_44 _GLIB_EXTERN
389 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_46
390 # define GLIB_DEPRECATED_IN_2_46 GLIB_DEPRECATED
391 # define GLIB_DEPRECATED_IN_2_46_FOR(f) GLIB_DEPRECATED_FOR(f)
393 # define GLIB_DEPRECATED_IN_2_46 _GLIB_EXTERN
394 # define GLIB_DEPRECATED_IN_2_46_FOR(f) _GLIB_EXTERN
397 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_46
398 # define GLIB_AVAILABLE_IN_2_46 GLIB_UNAVAILABLE(2, 46)
400 # define GLIB_AVAILABLE_IN_2_46 _GLIB_EXTERN
403 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_48
404 # define GLIB_DEPRECATED_IN_2_48 GLIB_DEPRECATED
405 # define GLIB_DEPRECATED_IN_2_48_FOR(f) GLIB_DEPRECATED_FOR(f)
407 # define GLIB_DEPRECATED_IN_2_48 _GLIB_EXTERN
408 # define GLIB_DEPRECATED_IN_2_48_FOR(f) _GLIB_EXTERN
411 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_48
412 # define GLIB_AVAILABLE_IN_2_48 GLIB_UNAVAILABLE(2, 48)
414 # define GLIB_AVAILABLE_IN_2_48 _GLIB_EXTERN
418 #endif /* __G_VERSION_MACROS_H__ */