regex: Add PARTIAL_HARD match option
[glib.git] / glib / gversionmacros.h
blobd18b8ebd06be2c88da014c6ecda68f447f265520
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, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GLib Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GLib Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GLib at ftp://ftp.gtk.org/pub/gtk/.
27 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
28 #error "Only <glib.h> can be included directly."
29 #endif
31 #ifndef __G_VERSION_MACROS_H__
32 #define __G_VERSION_MACROS_H__
34 /* Version boundaries checks */
36 #define G_ENCODE_VERSION(major,minor) ((major) << 16 | (minor) << 8)
38 /* XXX: Every new stable minor release bump should add a macro here */
40 /**
41 * GLIB_VERSION_2_26:
43 * A macro that evaluates to the 2.26 version of GLib, in a format
44 * that can be used by the C pre-processor.
46 * Since: 2.32
48 #define GLIB_VERSION_2_26 (G_ENCODE_VERSION (2, 26))
50 /**
51 * GLIB_VERSION_2_28:
53 * A macro that evaluates to the 2.28 version of GLib, in a format
54 * that can be used by the C pre-processor.
56 * Since: 2.32
58 #define GLIB_VERSION_2_28 (G_ENCODE_VERSION (2, 28))
60 /**
61 * GLIB_VERSION_2_30:
63 * A macro that evaluates to the 2.30 version of GLib, in a format
64 * that can be used by the C pre-processor.
66 * Since: 2.32
68 #define GLIB_VERSION_2_30 (G_ENCODE_VERSION (2, 30))
70 /**
71 * GLIB_VERSION_2_32:
73 * A macro that evaluates to the 2.32 version of GLib, in a format
74 * that can be used by the C pre-processor.
76 * Since: 2.32
78 #define GLIB_VERSION_2_32 (G_ENCODE_VERSION (2, 32))
80 /**
81 * GLIB_VERSION_2_34:
83 * A macro that evaluates to the 2.34 version of GLib, in a format
84 * that can be used by the C pre-processor.
86 * Since: 2.34
88 #define GLIB_VERSION_2_34 (G_ENCODE_VERSION (2, 34))
90 /* evaluates to the current stable version; for development cycles,
91 * this means the next stable target
93 #if (GLIB_MINOR_VERSION % 2)
94 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1))
95 #else
96 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION))
97 #endif
99 /* evaluates to the previous stable version */
100 #if (GLIB_MINOR_VERSION % 2)
101 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1))
102 #else
103 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2))
104 #endif
107 * GLIB_VERSION_MIN_REQUIRED:
109 * A macro that should be defined by the user prior to including
110 * the glib.h header.
111 * The definition should be one of the predefined GLib version
112 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
114 * This macro defines the lower bound for the GLib API to use.
116 * If a function has been deprecated in a newer version of GLib,
117 * it is possible to use this symbol to avoid the compiler warnings
118 * without disabling warning for every deprecated function.
120 * Since: 2.32
122 #ifndef GLIB_VERSION_MIN_REQUIRED
123 # define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE)
124 #endif
127 * GLIB_VERSION_MAX_ALLOWED:
129 * A macro that should be defined by the user prior to including
130 * the glib.h header.
131 * The definition should be one of the predefined GLib version
132 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
134 * This macro defines the upper bound for the GLib API to use.
136 * If a function has been introduced in a newer version of GLib,
137 * it is possible to use this symbol to get compiler warnings when
138 * trying to use that function.
140 * Since: 2.32
142 #ifndef GLIB_VERSION_MAX_ALLOWED
143 # define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_CUR_STABLE
144 #endif
146 /* sanity checks */
147 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED
148 #error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED"
149 #endif
150 #if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_26
151 #error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
152 #endif
154 /* These macros are used to mark deprecated functions in GLib headers,
155 * and thus have to be exposed in installed headers. But please
156 * do *not* use them in other projects. Instead, use G_DEPRECATED
157 * or define your own wrappers around it.
160 /* XXX: Every new stable minor release should add a set of macros here */
162 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_26
163 # define GLIB_DEPRECATED_IN_2_26 GLIB_DEPRECATED
164 # define GLIB_DEPRECATED_IN_2_26_FOR(f) GLIB_DEPRECATED_FOR(f)
165 #else
166 # define GLIB_DEPRECATED_IN_2_26
167 # define GLIB_DEPRECATED_IN_2_26_FOR(f)
168 #endif
170 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_26
171 # define GLIB_AVAILABLE_IN_2_26 GLIB_UNAVAILABLE(2, 26)
172 #else
173 # define GLIB_AVAILABLE_IN_2_26
174 #endif
176 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_28
177 # define GLIB_DEPRECATED_IN_2_28 GLIB_DEPRECATED
178 # define GLIB_DEPRECATED_IN_2_28_FOR(f) GLIB_DEPRECATED_FOR(f)
179 #else
180 # define GLIB_DEPRECATED_IN_2_28
181 # define GLIB_DEPRECATED_IN_2_28_FOR(f)
182 #endif
184 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_28
185 # define GLIB_AVAILABLE_IN_2_28 GLIB_UNAVAILABLE(2, 28)
186 #else
187 # define GLIB_AVAILABLE_IN_2_28
188 #endif
190 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_30
191 # define GLIB_DEPRECATED_IN_2_30 GLIB_DEPRECATED
192 # define GLIB_DEPRECATED_IN_2_30_FOR(f) GLIB_DEPRECATED_FOR(f)
193 #else
194 # define GLIB_DEPRECATED_IN_2_30
195 # define GLIB_DEPRECATED_IN_2_30_FOR(f)
196 #endif
198 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_30
199 # define GLIB_AVAILABLE_IN_2_30 GLIB_UNAVAILABLE(2, 30)
200 #else
201 # define GLIB_AVAILABLE_IN_2_30
202 #endif
204 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32
205 # define GLIB_DEPRECATED_IN_2_32 GLIB_DEPRECATED
206 # define GLIB_DEPRECATED_IN_2_32_FOR(f) GLIB_DEPRECATED_FOR(f)
207 #else
208 # define GLIB_DEPRECATED_IN_2_32
209 # define GLIB_DEPRECATED_IN_2_32_FOR(f)
210 #endif
212 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32
213 # define GLIB_AVAILABLE_IN_2_32 GLIB_UNAVAILABLE(2, 32)
214 #else
215 # define GLIB_AVAILABLE_IN_2_32
216 #endif
218 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34
219 # define GLIB_DEPRECATED_IN_2_34 GLIB_DEPRECATED
220 # define GLIB_DEPRECATED_IN_2_34_FOR(f) GLIB_DEPRECATED_FOR(f)
221 #else
222 # define GLIB_DEPRECATED_IN_2_34
223 # define GLIB_DEPRECATED_IN_2_34_FOR(f)
224 #endif
226 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34
227 # define GLIB_AVAILABLE_IN_2_34 GLIB_UNAVAILABLE(2, 34)
228 #else
229 # define GLIB_AVAILABLE_IN_2_34
230 #endif
232 #endif /* __G_VERSION_MACROS_H__ */