|
||||
File indexing completed on 2024-11-15 09:42:05
0001 /* GLIB - Library of useful routines for C programming 0002 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 0003 * 0004 * SPDX-License-Identifier: LGPL-2.1-or-later 0005 * 0006 * This library is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU Lesser General Public 0008 * License as published by the Free Software Foundation; either 0009 * version 2.1 of the License, or (at your option) any later version. 0010 * 0011 * This library is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 * Lesser General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU Lesser General Public 0017 * License along with this library; if not, see <http://www.gnu.org/licenses/>. 0018 */ 0019 0020 /* 0021 * Modified by the GLib Team and others 1997-2000. See the AUTHORS 0022 * file for a list of people on the GLib Team. See the ChangeLog 0023 * files for a list of changes. These files are distributed with 0024 * GLib at ftp://ftp.gtk.org/pub/gtk/. 0025 */ 0026 0027 #ifndef __G_VERSION_MACROS_H__ 0028 #define __G_VERSION_MACROS_H__ 0029 0030 #if !defined(__GLIB_H_INSIDE__) && !defined(GLIB_COMPILATION) 0031 #error "Only <glib.h> can be included directly." 0032 #endif 0033 0034 /* Version boundaries checks */ 0035 0036 #define G_ENCODE_VERSION(major, minor) ((major) << 16 | (minor) << 8) 0037 0038 /** 0039 * GLIB_VERSION_2_2: 0040 * 0041 * A macro that evaluates to the 2.2 version of GLib, in a format 0042 * that can be used by the C pre-processor. 0043 * 0044 * Since: 2.32 0045 */ 0046 #define GLIB_VERSION_2_2 (G_ENCODE_VERSION (2, 2)) 0047 /** 0048 * GLIB_VERSION_2_4: 0049 * 0050 * A macro that evaluates to the 2.4 version of GLib, in a format 0051 * that can be used by the C pre-processor. 0052 * 0053 * Since: 2.32 0054 */ 0055 #define GLIB_VERSION_2_4 (G_ENCODE_VERSION (2, 4)) 0056 /** 0057 * GLIB_VERSION_2_6: 0058 * 0059 * A macro that evaluates to the 2.6 version of GLib, in a format 0060 * that can be used by the C pre-processor. 0061 * 0062 * Since: 2.32 0063 */ 0064 #define GLIB_VERSION_2_6 (G_ENCODE_VERSION (2, 6)) 0065 /** 0066 * GLIB_VERSION_2_8: 0067 * 0068 * A macro that evaluates to the 2.8 version of GLib, in a format 0069 * that can be used by the C pre-processor. 0070 * 0071 * Since: 2.32 0072 */ 0073 #define GLIB_VERSION_2_8 (G_ENCODE_VERSION (2, 8)) 0074 /** 0075 * GLIB_VERSION_2_10: 0076 * 0077 * A macro that evaluates to the 2.10 version of GLib, in a format 0078 * that can be used by the C pre-processor. 0079 * 0080 * Since: 2.32 0081 */ 0082 #define GLIB_VERSION_2_10 (G_ENCODE_VERSION (2, 10)) 0083 /** 0084 * GLIB_VERSION_2_12: 0085 * 0086 * A macro that evaluates to the 2.12 version of GLib, in a format 0087 * that can be used by the C pre-processor. 0088 * 0089 * Since: 2.32 0090 */ 0091 #define GLIB_VERSION_2_12 (G_ENCODE_VERSION (2, 12)) 0092 /** 0093 * GLIB_VERSION_2_14: 0094 * 0095 * A macro that evaluates to the 2.14 version of GLib, in a format 0096 * that can be used by the C pre-processor. 0097 * 0098 * Since: 2.32 0099 */ 0100 #define GLIB_VERSION_2_14 (G_ENCODE_VERSION (2, 14)) 0101 /** 0102 * GLIB_VERSION_2_16: 0103 * 0104 * A macro that evaluates to the 2.16 version of GLib, in a format 0105 * that can be used by the C pre-processor. 0106 * 0107 * Since: 2.32 0108 */ 0109 #define GLIB_VERSION_2_16 (G_ENCODE_VERSION (2, 16)) 0110 /** 0111 * GLIB_VERSION_2_18: 0112 * 0113 * A macro that evaluates to the 2.18 version of GLib, in a format 0114 * that can be used by the C pre-processor. 0115 * 0116 * Since: 2.32 0117 */ 0118 #define GLIB_VERSION_2_18 (G_ENCODE_VERSION (2, 18)) 0119 /** 0120 * GLIB_VERSION_2_20: 0121 * 0122 * A macro that evaluates to the 2.20 version of GLib, in a format 0123 * that can be used by the C pre-processor. 0124 * 0125 * Since: 2.32 0126 */ 0127 #define GLIB_VERSION_2_20 (G_ENCODE_VERSION (2, 20)) 0128 /** 0129 * GLIB_VERSION_2_22: 0130 * 0131 * A macro that evaluates to the 2.22 version of GLib, in a format 0132 * that can be used by the C pre-processor. 0133 * 0134 * Since: 2.32 0135 */ 0136 #define GLIB_VERSION_2_22 (G_ENCODE_VERSION (2, 22)) 0137 /** 0138 * GLIB_VERSION_2_24: 0139 * 0140 * A macro that evaluates to the 2.24 version of GLib, in a format 0141 * that can be used by the C pre-processor. 0142 * 0143 * Since: 2.32 0144 */ 0145 #define GLIB_VERSION_2_24 (G_ENCODE_VERSION (2, 24)) 0146 /** 0147 * GLIB_VERSION_2_26: 0148 * 0149 * A macro that evaluates to the 2.26 version of GLib, in a format 0150 * that can be used by the C pre-processor. 0151 * 0152 * Since: 2.32 0153 */ 0154 #define GLIB_VERSION_2_26 (G_ENCODE_VERSION (2, 26)) 0155 /** 0156 * GLIB_VERSION_2_28: 0157 * 0158 * A macro that evaluates to the 2.28 version of GLib, in a format 0159 * that can be used by the C pre-processor. 0160 * 0161 * Since: 2.32 0162 */ 0163 #define GLIB_VERSION_2_28 (G_ENCODE_VERSION (2, 28)) 0164 /** 0165 * GLIB_VERSION_2_30: 0166 * 0167 * A macro that evaluates to the 2.30 version of GLib, in a format 0168 * that can be used by the C pre-processor. 0169 * 0170 * Since: 2.32 0171 */ 0172 #define GLIB_VERSION_2_30 (G_ENCODE_VERSION (2, 30)) 0173 /** 0174 * GLIB_VERSION_2_32: 0175 * 0176 * A macro that evaluates to the 2.32 version of GLib, in a format 0177 * that can be used by the C pre-processor. 0178 * 0179 * Since: 2.32 0180 */ 0181 #define GLIB_VERSION_2_32 (G_ENCODE_VERSION (2, 32)) 0182 /** 0183 * GLIB_VERSION_2_34: 0184 * 0185 * A macro that evaluates to the 2.34 version of GLib, in a format 0186 * that can be used by the C pre-processor. 0187 * 0188 * Since: 2.34 0189 */ 0190 #define GLIB_VERSION_2_34 (G_ENCODE_VERSION (2, 34)) 0191 /** 0192 * GLIB_VERSION_2_36: 0193 * 0194 * A macro that evaluates to the 2.36 version of GLib, in a format 0195 * that can be used by the C pre-processor. 0196 * 0197 * Since: 2.36 0198 */ 0199 #define GLIB_VERSION_2_36 (G_ENCODE_VERSION (2, 36)) 0200 /** 0201 * GLIB_VERSION_2_38: 0202 * 0203 * A macro that evaluates to the 2.38 version of GLib, in a format 0204 * that can be used by the C pre-processor. 0205 * 0206 * Since: 2.38 0207 */ 0208 #define GLIB_VERSION_2_38 (G_ENCODE_VERSION (2, 38)) 0209 /** 0210 * GLIB_VERSION_2_40: 0211 * 0212 * A macro that evaluates to the 2.40 version of GLib, in a format 0213 * that can be used by the C pre-processor. 0214 * 0215 * Since: 2.40 0216 */ 0217 #define GLIB_VERSION_2_40 (G_ENCODE_VERSION (2, 40)) 0218 /** 0219 * GLIB_VERSION_2_42: 0220 * 0221 * A macro that evaluates to the 2.42 version of GLib, in a format 0222 * that can be used by the C pre-processor. 0223 * 0224 * Since: 2.42 0225 */ 0226 #define GLIB_VERSION_2_42 (G_ENCODE_VERSION (2, 42)) 0227 /** 0228 * GLIB_VERSION_2_44: 0229 * 0230 * A macro that evaluates to the 2.44 version of GLib, in a format 0231 * that can be used by the C pre-processor. 0232 * 0233 * Since: 2.44 0234 */ 0235 #define GLIB_VERSION_2_44 (G_ENCODE_VERSION (2, 44)) 0236 /** 0237 * GLIB_VERSION_2_46: 0238 * 0239 * A macro that evaluates to the 2.46 version of GLib, in a format 0240 * that can be used by the C pre-processor. 0241 * 0242 * Since: 2.46 0243 */ 0244 #define GLIB_VERSION_2_46 (G_ENCODE_VERSION (2, 46)) 0245 /** 0246 * GLIB_VERSION_2_48: 0247 * 0248 * A macro that evaluates to the 2.48 version of GLib, in a format 0249 * that can be used by the C pre-processor. 0250 * 0251 * Since: 2.48 0252 */ 0253 #define GLIB_VERSION_2_48 (G_ENCODE_VERSION (2, 48)) 0254 /** 0255 * GLIB_VERSION_2_50: 0256 * 0257 * A macro that evaluates to the 2.50 version of GLib, in a format 0258 * that can be used by the C pre-processor. 0259 * 0260 * Since: 2.50 0261 */ 0262 #define GLIB_VERSION_2_50 (G_ENCODE_VERSION (2, 50)) 0263 /** 0264 * GLIB_VERSION_2_52: 0265 * 0266 * A macro that evaluates to the 2.52 version of GLib, in a format 0267 * that can be used by the C pre-processor. 0268 * 0269 * Since: 2.52 0270 */ 0271 #define GLIB_VERSION_2_52 (G_ENCODE_VERSION (2, 52)) 0272 /** 0273 * GLIB_VERSION_2_54: 0274 * 0275 * A macro that evaluates to the 2.54 version of GLib, in a format 0276 * that can be used by the C pre-processor. 0277 * 0278 * Since: 2.54 0279 */ 0280 #define GLIB_VERSION_2_54 (G_ENCODE_VERSION (2, 54)) 0281 /** 0282 * GLIB_VERSION_2_56: 0283 * 0284 * A macro that evaluates to the 2.56 version of GLib, in a format 0285 * that can be used by the C pre-processor. 0286 * 0287 * Since: 2.56 0288 */ 0289 #define GLIB_VERSION_2_56 (G_ENCODE_VERSION (2, 56)) 0290 /** 0291 * GLIB_VERSION_2_58: 0292 * 0293 * A macro that evaluates to the 2.58 version of GLib, in a format 0294 * that can be used by the C pre-processor. 0295 * 0296 * Since: 2.58 0297 */ 0298 #define GLIB_VERSION_2_58 (G_ENCODE_VERSION (2, 58)) 0299 /** 0300 * GLIB_VERSION_2_60: 0301 * 0302 * A macro that evaluates to the 2.60 version of GLib, in a format 0303 * that can be used by the C pre-processor. 0304 * 0305 * Since: 2.60 0306 */ 0307 #define GLIB_VERSION_2_60 (G_ENCODE_VERSION (2, 60)) 0308 /** 0309 * GLIB_VERSION_2_62: 0310 * 0311 * A macro that evaluates to the 2.62 version of GLib, in a format 0312 * that can be used by the C pre-processor. 0313 * 0314 * Since: 2.62 0315 */ 0316 #define GLIB_VERSION_2_62 (G_ENCODE_VERSION (2, 62)) 0317 /** 0318 * GLIB_VERSION_2_64: 0319 * 0320 * A macro that evaluates to the 2.64 version of GLib, in a format 0321 * that can be used by the C pre-processor. 0322 * 0323 * Since: 2.64 0324 */ 0325 #define GLIB_VERSION_2_64 (G_ENCODE_VERSION (2, 64)) 0326 /** 0327 * GLIB_VERSION_2_66: 0328 * 0329 * A macro that evaluates to the 2.66 version of GLib, in a format 0330 * that can be used by the C pre-processor. 0331 * 0332 * Since: 2.66 0333 */ 0334 #define GLIB_VERSION_2_66 (G_ENCODE_VERSION (2, 66)) 0335 /** 0336 * GLIB_VERSION_2_68: 0337 * 0338 * A macro that evaluates to the 2.68 version of GLib, in a format 0339 * that can be used by the C pre-processor. 0340 * 0341 * Since: 2.68 0342 */ 0343 #define GLIB_VERSION_2_68 (G_ENCODE_VERSION (2, 68)) 0344 /** 0345 * GLIB_VERSION_2_70: 0346 * 0347 * A macro that evaluates to the 2.70 version of GLib, in a format 0348 * that can be used by the C pre-processor. 0349 * 0350 * Since: 2.70 0351 */ 0352 #define GLIB_VERSION_2_70 (G_ENCODE_VERSION (2, 70)) 0353 /** 0354 * GLIB_VERSION_2_72: 0355 * 0356 * A macro that evaluates to the 2.72 version of GLib, in a format 0357 * that can be used by the C pre-processor. 0358 * 0359 * Since: 2.72 0360 */ 0361 #define GLIB_VERSION_2_72 (G_ENCODE_VERSION (2, 72)) 0362 /** 0363 * GLIB_VERSION_2_74: 0364 * 0365 * A macro that evaluates to the 2.74 version of GLib, in a format 0366 * that can be used by the C pre-processor. 0367 * 0368 * Since: 2.74 0369 */ 0370 #define GLIB_VERSION_2_74 (G_ENCODE_VERSION (2, 74)) 0371 /** 0372 * GLIB_VERSION_2_76: 0373 * 0374 * A macro that evaluates to the 2.76 version of GLib, in a format 0375 * that can be used by the C pre-processor. 0376 * 0377 * Since: 2.76 0378 */ 0379 #define GLIB_VERSION_2_76 (G_ENCODE_VERSION (2, 76)) 0380 /** 0381 * GLIB_VERSION_2_78: 0382 * 0383 * A macro that evaluates to the 2.78 version of GLib, in a format 0384 * that can be used by the C pre-processor. 0385 * 0386 * Since: 2.78 0387 */ 0388 #define GLIB_VERSION_2_78 (G_ENCODE_VERSION (2, 78)) 0389 0390 /** 0391 * GLIB_VERSION_CUR_STABLE: 0392 * 0393 * A macro that evaluates to the current stable version of GLib, in a format 0394 * that can be used by the C pre-processor. 0395 * 0396 * During an unstable development cycle, this evaluates to the next stable 0397 * (unreleased) version which will be the result of the development cycle. 0398 * 0399 * Since: 2.32 0400 */ 0401 #if (GLIB_MINOR_VERSION % 2) 0402 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1)) 0403 #else 0404 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION)) 0405 #endif 0406 0407 /** 0408 * GLIB_VERSION_PREV_STABLE: 0409 * 0410 * A macro that evaluates to the previous stable version of GLib, in a format 0411 * that can be used by the C pre-processor. 0412 * 0413 * During an unstable development cycle, this evaluates to the most recent 0414 * released stable release, which preceded this development cycle. 0415 * 0416 * Since: 2.32 0417 */ 0418 #if (GLIB_MINOR_VERSION % 2) 0419 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1)) 0420 #else 0421 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2)) 0422 #endif 0423 0424 /** 0425 * GLIB_VERSION_MIN_REQUIRED: 0426 * 0427 * A macro that should be defined by the user prior to including 0428 * the glib.h header. 0429 * The definition should be one of the predefined GLib version 0430 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... 0431 * 0432 * This macro defines the earliest version of GLib that the package is 0433 * required to be able to compile against. 0434 * 0435 * If the compiler is configured to warn about the use of deprecated 0436 * functions, then using functions that were deprecated in version 0437 * %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but 0438 * using functions deprecated in later releases will not). 0439 * 0440 * Since: 2.32 0441 */ 0442 /* If the package sets GLIB_VERSION_MIN_REQUIRED to some future 0443 * GLIB_VERSION_X_Y value that we don't know about, it will compare as 0444 * 0 in preprocessor tests. 0445 */ 0446 #ifndef GLIB_VERSION_MIN_REQUIRED 0447 #define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE) 0448 #elif GLIB_VERSION_MIN_REQUIRED == 0 0449 #undef GLIB_VERSION_MIN_REQUIRED 0450 #define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE + 2) 0451 #endif 0452 0453 /** 0454 * GLIB_VERSION_MAX_ALLOWED: 0455 * 0456 * A macro that should be defined by the user prior to including 0457 * the glib.h header. 0458 * The definition should be one of the predefined GLib version 0459 * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... 0460 * 0461 * This macro defines the latest version of the GLib API that the 0462 * package is allowed to make use of. 0463 * 0464 * If the compiler is configured to warn about the use of deprecated 0465 * functions, then using functions added after version 0466 * %GLIB_VERSION_MAX_ALLOWED will cause warnings. 0467 * 0468 * Unless you are using GLIB_CHECK_VERSION() or the like to compile 0469 * different code depending on the GLib version, then this should be 0470 * set to the same value as %GLIB_VERSION_MIN_REQUIRED. 0471 * 0472 * Since: 2.32 0473 */ 0474 #if !defined(GLIB_VERSION_MAX_ALLOWED) || (GLIB_VERSION_MAX_ALLOWED == 0) 0475 #undef GLIB_VERSION_MAX_ALLOWED 0476 #define GLIB_VERSION_MAX_ALLOWED (GLIB_VERSION_CUR_STABLE) 0477 #endif 0478 0479 /* sanity checks */ 0480 #if GLIB_VERSION_MIN_REQUIRED > GLIB_VERSION_CUR_STABLE 0481 #error "GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE" 0482 #endif 0483 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED 0484 #error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED" 0485 #endif 0486 #if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_26 0487 #error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26" 0488 #endif 0489 0490 #endif /* __G_VERSION_MACROS_H__ */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |