unicode: Move gscripttable.h generation into main script
[platform/upstream/glib.git] / glib / gversionmacros.h
1 /* GLIB - Library of useful routines for C programming
2  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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/>.
16  */
17
18 /*
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/.
23  */
24
25 #ifndef __G_VERSION_MACROS_H__
26 #define __G_VERSION_MACROS_H__
27
28 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
29 #error "Only <glib.h> can be included directly."
30 #endif
31
32 /* Version boundaries checks */
33
34 #define G_ENCODE_VERSION(major,minor)   ((major) << 16 | (minor) << 8)
35
36 /* XXX: Every new stable minor release bump should add a macro here */
37
38 /**
39  * GLIB_VERSION_2_26:
40  *
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.
43  *
44  * Since: 2.32
45  */
46 #define GLIB_VERSION_2_26       (G_ENCODE_VERSION (2, 26))
47
48 /**
49  * GLIB_VERSION_2_28:
50  *
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.
53  *
54  * Since: 2.32
55  */
56 #define GLIB_VERSION_2_28       (G_ENCODE_VERSION (2, 28))
57
58 /**
59  * GLIB_VERSION_2_30:
60  *
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.
63  *
64  * Since: 2.32
65  */
66 #define GLIB_VERSION_2_30       (G_ENCODE_VERSION (2, 30))
67
68 /**
69  * GLIB_VERSION_2_32:
70  *
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.
73  *
74  * Since: 2.32
75  */
76 #define GLIB_VERSION_2_32       (G_ENCODE_VERSION (2, 32))
77
78 /**
79  * GLIB_VERSION_2_34:
80  *
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.
83  *
84  * Since: 2.34
85  */
86 #define GLIB_VERSION_2_34       (G_ENCODE_VERSION (2, 34))
87
88 /**
89  * GLIB_VERSION_2_36:
90  *
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.
93  *
94  * Since: 2.36
95  */
96 #define GLIB_VERSION_2_36       (G_ENCODE_VERSION (2, 36))
97
98 /**
99  * GLIB_VERSION_2_38:
100  *
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.
103  *
104  * Since: 2.38
105  */
106 #define GLIB_VERSION_2_38       (G_ENCODE_VERSION (2, 38))
107
108 /**
109  * GLIB_VERSION_2_40:
110  *
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.
113  *
114  * Since: 2.40
115  */
116 #define GLIB_VERSION_2_40       (G_ENCODE_VERSION (2, 40))
117
118 /**
119  * GLIB_VERSION_2_42:
120  *
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.
123  *
124  * Since: 2.42
125  */
126 #define GLIB_VERSION_2_42       (G_ENCODE_VERSION (2, 42))
127
128 /* evaluates to the current stable version; for development cycles,
129  * this means the next stable target
130  */
131 #if (GLIB_MINOR_VERSION % 2)
132 #define GLIB_VERSION_CUR_STABLE         (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1))
133 #else
134 #define GLIB_VERSION_CUR_STABLE         (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION))
135 #endif
136
137 /* evaluates to the previous stable version */
138 #if (GLIB_MINOR_VERSION % 2)
139 #define GLIB_VERSION_PREV_STABLE        (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1))
140 #else
141 #define GLIB_VERSION_PREV_STABLE        (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2))
142 #endif
143
144 /**
145  * GLIB_VERSION_MIN_REQUIRED:
146  *
147  * A macro that should be defined by the user prior to including
148  * the glib.h header.
149  * The definition should be one of the predefined GLib version
150  * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
151  *
152  * This macro defines the earliest version of GLib that the package is
153  * required to be able to compile against.
154  *
155  * If the compiler is configured to warn about the use of deprecated
156  * functions, then using functions that were deprecated in version
157  * %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but
158  * using functions deprecated in later releases will not).
159  *
160  * Since: 2.32
161  */
162 /* If the package sets GLIB_VERSION_MIN_REQUIRED to some future
163  * GLIB_VERSION_X_Y value that we don't know about, it will compare as
164  * 0 in preprocessor tests.
165  */
166 #ifndef GLIB_VERSION_MIN_REQUIRED
167 # define GLIB_VERSION_MIN_REQUIRED      (GLIB_VERSION_CUR_STABLE)
168 #elif GLIB_VERSION_MIN_REQUIRED == 0
169 # undef  GLIB_VERSION_MIN_REQUIRED
170 # define GLIB_VERSION_MIN_REQUIRED      (GLIB_VERSION_CUR_STABLE + 2)
171 #endif
172
173 /**
174  * GLIB_VERSION_MAX_ALLOWED:
175  *
176  * A macro that should be defined by the user prior to including
177  * the glib.h header.
178  * The definition should be one of the predefined GLib version
179  * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
180  *
181  * This macro defines the latest version of the GLib API that the
182  * package is allowed to make use of.
183  *
184  * If the compiler is configured to warn about the use of deprecated
185  * functions, then using functions added after version
186  * %GLIB_VERSION_MAX_ALLOWED will cause warnings.
187  *
188  * Unless you are using GLIB_CHECK_VERSION() or the like to compile
189  * different code depending on the GLib version, then this should be
190  * set to the same value as %GLIB_VERSION_MIN_REQUIRED.
191  *
192  * Since: 2.32
193  */
194 #if !defined (GLIB_VERSION_MAX_ALLOWED) || (GLIB_VERSION_MAX_ALLOWED == 0)
195 # undef GLIB_VERSION_MAX_ALLOWED
196 # define GLIB_VERSION_MAX_ALLOWED      (GLIB_VERSION_CUR_STABLE)
197 #endif
198
199 /* sanity checks */
200 #if GLIB_VERSION_MIN_REQUIRED > GLIB_VERSION_CUR_STABLE
201 #error "GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE"
202 #endif
203 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED
204 #error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED"
205 #endif
206 #if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_26
207 #error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
208 #endif
209
210 /* These macros are used to mark deprecated functions in GLib headers,
211  * and thus have to be exposed in installed headers. But please
212  * do *not* use them in other projects. Instead, use G_DEPRECATED
213  * or define your own wrappers around it.
214  */
215 #define GLIB_AVAILABLE_IN_ALL                   _GLIB_EXTERN
216
217 /* XXX: Every new stable minor release should add a set of macros here */
218
219 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_26
220 # define GLIB_DEPRECATED_IN_2_26                GLIB_DEPRECATED
221 # define GLIB_DEPRECATED_IN_2_26_FOR(f)         GLIB_DEPRECATED_FOR(f)
222 #else
223 # define GLIB_DEPRECATED_IN_2_26                _GLIB_EXTERN
224 # define GLIB_DEPRECATED_IN_2_26_FOR(f)         _GLIB_EXTERN
225 #endif
226
227 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_26
228 # define GLIB_AVAILABLE_IN_2_26                 GLIB_UNAVAILABLE(2, 26)
229 #else
230 # define GLIB_AVAILABLE_IN_2_26                 _GLIB_EXTERN
231 #endif
232
233 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_28
234 # define GLIB_DEPRECATED_IN_2_28                GLIB_DEPRECATED
235 # define GLIB_DEPRECATED_IN_2_28_FOR(f)         GLIB_DEPRECATED_FOR(f)
236 #else
237 # define GLIB_DEPRECATED_IN_2_28                _GLIB_EXTERN
238 # define GLIB_DEPRECATED_IN_2_28_FOR(f)         _GLIB_EXTERN
239 #endif
240
241 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_28
242 # define GLIB_AVAILABLE_IN_2_28                 GLIB_UNAVAILABLE(2, 28)
243 #else
244 # define GLIB_AVAILABLE_IN_2_28                 _GLIB_EXTERN
245 #endif
246
247 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_30
248 # define GLIB_DEPRECATED_IN_2_30                GLIB_DEPRECATED
249 # define GLIB_DEPRECATED_IN_2_30_FOR(f)         GLIB_DEPRECATED_FOR(f)
250 #else
251 # define GLIB_DEPRECATED_IN_2_30                _GLIB_EXTERN
252 # define GLIB_DEPRECATED_IN_2_30_FOR(f)         _GLIB_EXTERN
253 #endif
254
255 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_30
256 # define GLIB_AVAILABLE_IN_2_30                 GLIB_UNAVAILABLE(2, 30)
257 #else
258 # define GLIB_AVAILABLE_IN_2_30                 _GLIB_EXTERN
259 #endif
260
261 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32
262 # define GLIB_DEPRECATED_IN_2_32                GLIB_DEPRECATED
263 # define GLIB_DEPRECATED_IN_2_32_FOR(f)         GLIB_DEPRECATED_FOR(f)
264 #else
265 # define GLIB_DEPRECATED_IN_2_32                _GLIB_EXTERN
266 # define GLIB_DEPRECATED_IN_2_32_FOR(f)         _GLIB_EXTERN
267 #endif
268
269 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32
270 # define GLIB_AVAILABLE_IN_2_32                 GLIB_UNAVAILABLE(2, 32)
271 #else
272 # define GLIB_AVAILABLE_IN_2_32                 _GLIB_EXTERN
273 #endif
274
275 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34
276 # define GLIB_DEPRECATED_IN_2_34                GLIB_DEPRECATED
277 # define GLIB_DEPRECATED_IN_2_34_FOR(f)         GLIB_DEPRECATED_FOR(f)
278 #else
279 # define GLIB_DEPRECATED_IN_2_34                _GLIB_EXTERN
280 # define GLIB_DEPRECATED_IN_2_34_FOR(f)         _GLIB_EXTERN
281 #endif
282
283 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34
284 # define GLIB_AVAILABLE_IN_2_34                 GLIB_UNAVAILABLE(2, 34)
285 #else
286 # define GLIB_AVAILABLE_IN_2_34                 _GLIB_EXTERN
287 #endif
288
289 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_36
290 # define GLIB_DEPRECATED_IN_2_36                GLIB_DEPRECATED
291 # define GLIB_DEPRECATED_IN_2_36_FOR(f)         GLIB_DEPRECATED_FOR(f)
292 #else
293 # define GLIB_DEPRECATED_IN_2_36                _GLIB_EXTERN
294 # define GLIB_DEPRECATED_IN_2_36_FOR(f)         _GLIB_EXTERN
295 #endif
296
297 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_36
298 # define GLIB_AVAILABLE_IN_2_36                 GLIB_UNAVAILABLE(2, 36)
299 #else
300 # define GLIB_AVAILABLE_IN_2_36                 _GLIB_EXTERN
301 #endif
302
303 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_38
304 # define GLIB_DEPRECATED_IN_2_38                GLIB_DEPRECATED
305 # define GLIB_DEPRECATED_IN_2_38_FOR(f)         GLIB_DEPRECATED_FOR(f)
306 #else
307 # define GLIB_DEPRECATED_IN_2_38                _GLIB_EXTERN
308 # define GLIB_DEPRECATED_IN_2_38_FOR(f)         _GLIB_EXTERN
309 #endif
310
311 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
312 # define GLIB_AVAILABLE_IN_2_38                 GLIB_UNAVAILABLE(2, 38)
313 #else
314 # define GLIB_AVAILABLE_IN_2_38                 _GLIB_EXTERN
315 #endif
316
317 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_40
318 # define GLIB_DEPRECATED_IN_2_40                GLIB_DEPRECATED
319 # define GLIB_DEPRECATED_IN_2_40_FOR(f)         GLIB_DEPRECATED_FOR(f)
320 #else
321 # define GLIB_DEPRECATED_IN_2_40                _GLIB_EXTERN
322 # define GLIB_DEPRECATED_IN_2_40_FOR(f)         _GLIB_EXTERN
323 #endif
324
325 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_40
326 # define GLIB_AVAILABLE_IN_2_40                 GLIB_UNAVAILABLE(2, 40)
327 #else
328 # define GLIB_AVAILABLE_IN_2_40                 _GLIB_EXTERN
329 #endif
330
331 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_42
332 # define GLIB_DEPRECATED_IN_2_42                GLIB_DEPRECATED
333 # define GLIB_DEPRECATED_IN_2_42_FOR(f)         GLIB_DEPRECATED_FOR(f)
334 #else
335 # define GLIB_DEPRECATED_IN_2_42                _GLIB_EXTERN
336 # define GLIB_DEPRECATED_IN_2_42_FOR(f)         _GLIB_EXTERN
337 #endif
338
339 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_42
340 # define GLIB_AVAILABLE_IN_2_42                 GLIB_UNAVAILABLE(2, 42)
341 #else
342 # define GLIB_AVAILABLE_IN_2_42                 _GLIB_EXTERN
343 #endif
344
345 #endif /*  __G_VERSION_MACROS_H__ */