Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/glib-2.0/glib/gversionmacros.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 /**
0037  * G_ENCODE_VERSION:
0038  * @major: major version number
0039  * @minor: minor version number
0040  *
0041  * Encode a major.minor version as a single integer.
0042  *
0043  * This is the encoding used by macros such as `GLIB_VERSION_2_84` and
0044  * `GLIB_VERSION_CUR_STABLE`, and is intended to be used when (for example)
0045  * setting the value of `GLIB_VERSION_MAX_ALLOWED`.
0046  *
0047  * Since: 2.32
0048  */
0049 #define G_ENCODE_VERSION(major, minor) ((major) << 16 | (minor) << 8)
0050 
0051 /**
0052 * GLIB_VERSION_2_2:
0053 *
0054 * A macro that evaluates to the 2.2 version of GLib, in a format
0055 * that can be used by the C pre-processor.
0056 *
0057 * Since: 2.32
0058 */
0059 #define GLIB_VERSION_2_2       (G_ENCODE_VERSION (2, 2))
0060 /**
0061 * GLIB_VERSION_2_4:
0062 *
0063 * A macro that evaluates to the 2.4 version of GLib, in a format
0064 * that can be used by the C pre-processor.
0065 *
0066 * Since: 2.32
0067 */
0068 #define GLIB_VERSION_2_4       (G_ENCODE_VERSION (2, 4))
0069 /**
0070 * GLIB_VERSION_2_6:
0071 *
0072 * A macro that evaluates to the 2.6 version of GLib, in a format
0073 * that can be used by the C pre-processor.
0074 *
0075 * Since: 2.32
0076 */
0077 #define GLIB_VERSION_2_6       (G_ENCODE_VERSION (2, 6))
0078 /**
0079 * GLIB_VERSION_2_8:
0080 *
0081 * A macro that evaluates to the 2.8 version of GLib, in a format
0082 * that can be used by the C pre-processor.
0083 *
0084 * Since: 2.32
0085 */
0086 #define GLIB_VERSION_2_8       (G_ENCODE_VERSION (2, 8))
0087 /**
0088 * GLIB_VERSION_2_10:
0089 *
0090 * A macro that evaluates to the 2.10 version of GLib, in a format
0091 * that can be used by the C pre-processor.
0092 *
0093 * Since: 2.32
0094 */
0095 #define GLIB_VERSION_2_10       (G_ENCODE_VERSION (2, 10))
0096 /**
0097 * GLIB_VERSION_2_12:
0098 *
0099 * A macro that evaluates to the 2.12 version of GLib, in a format
0100 * that can be used by the C pre-processor.
0101 *
0102 * Since: 2.32
0103 */
0104 #define GLIB_VERSION_2_12       (G_ENCODE_VERSION (2, 12))
0105 /**
0106 * GLIB_VERSION_2_14:
0107 *
0108 * A macro that evaluates to the 2.14 version of GLib, in a format
0109 * that can be used by the C pre-processor.
0110 *
0111 * Since: 2.32
0112 */
0113 #define GLIB_VERSION_2_14       (G_ENCODE_VERSION (2, 14))
0114 /**
0115 * GLIB_VERSION_2_16:
0116 *
0117 * A macro that evaluates to the 2.16 version of GLib, in a format
0118 * that can be used by the C pre-processor.
0119 *
0120 * Since: 2.32
0121 */
0122 #define GLIB_VERSION_2_16       (G_ENCODE_VERSION (2, 16))
0123 /**
0124 * GLIB_VERSION_2_18:
0125 *
0126 * A macro that evaluates to the 2.18 version of GLib, in a format
0127 * that can be used by the C pre-processor.
0128 *
0129 * Since: 2.32
0130 */
0131 #define GLIB_VERSION_2_18       (G_ENCODE_VERSION (2, 18))
0132 /**
0133 * GLIB_VERSION_2_20:
0134 *
0135 * A macro that evaluates to the 2.20 version of GLib, in a format
0136 * that can be used by the C pre-processor.
0137 *
0138 * Since: 2.32
0139 */
0140 #define GLIB_VERSION_2_20       (G_ENCODE_VERSION (2, 20))
0141 /**
0142 * GLIB_VERSION_2_22:
0143 *
0144 * A macro that evaluates to the 2.22 version of GLib, in a format
0145 * that can be used by the C pre-processor.
0146 *
0147 * Since: 2.32
0148 */
0149 #define GLIB_VERSION_2_22       (G_ENCODE_VERSION (2, 22))
0150 /**
0151 * GLIB_VERSION_2_24:
0152 *
0153 * A macro that evaluates to the 2.24 version of GLib, in a format
0154 * that can be used by the C pre-processor.
0155 *
0156 * Since: 2.32
0157 */
0158 #define GLIB_VERSION_2_24       (G_ENCODE_VERSION (2, 24))
0159 /**
0160 * GLIB_VERSION_2_26:
0161 *
0162 * A macro that evaluates to the 2.26 version of GLib, in a format
0163 * that can be used by the C pre-processor.
0164 *
0165 * Since: 2.32
0166 */
0167 #define GLIB_VERSION_2_26       (G_ENCODE_VERSION (2, 26))
0168 /**
0169 * GLIB_VERSION_2_28:
0170 *
0171 * A macro that evaluates to the 2.28 version of GLib, in a format
0172 * that can be used by the C pre-processor.
0173 *
0174 * Since: 2.32
0175 */
0176 #define GLIB_VERSION_2_28       (G_ENCODE_VERSION (2, 28))
0177 /**
0178 * GLIB_VERSION_2_30:
0179 *
0180 * A macro that evaluates to the 2.30 version of GLib, in a format
0181 * that can be used by the C pre-processor.
0182 *
0183 * Since: 2.32
0184 */
0185 #define GLIB_VERSION_2_30       (G_ENCODE_VERSION (2, 30))
0186 /**
0187 * GLIB_VERSION_2_32:
0188 *
0189 * A macro that evaluates to the 2.32 version of GLib, in a format
0190 * that can be used by the C pre-processor.
0191 *
0192 * Since: 2.32
0193 */
0194 #define GLIB_VERSION_2_32       (G_ENCODE_VERSION (2, 32))
0195 /**
0196 * GLIB_VERSION_2_34:
0197 *
0198 * A macro that evaluates to the 2.34 version of GLib, in a format
0199 * that can be used by the C pre-processor.
0200 *
0201 * Since: 2.34
0202 */
0203 #define GLIB_VERSION_2_34       (G_ENCODE_VERSION (2, 34))
0204 /**
0205 * GLIB_VERSION_2_36:
0206 *
0207 * A macro that evaluates to the 2.36 version of GLib, in a format
0208 * that can be used by the C pre-processor.
0209 *
0210 * Since: 2.36
0211 */
0212 #define GLIB_VERSION_2_36       (G_ENCODE_VERSION (2, 36))
0213 /**
0214 * GLIB_VERSION_2_38:
0215 *
0216 * A macro that evaluates to the 2.38 version of GLib, in a format
0217 * that can be used by the C pre-processor.
0218 *
0219 * Since: 2.38
0220 */
0221 #define GLIB_VERSION_2_38       (G_ENCODE_VERSION (2, 38))
0222 /**
0223 * GLIB_VERSION_2_40:
0224 *
0225 * A macro that evaluates to the 2.40 version of GLib, in a format
0226 * that can be used by the C pre-processor.
0227 *
0228 * Since: 2.40
0229 */
0230 #define GLIB_VERSION_2_40       (G_ENCODE_VERSION (2, 40))
0231 /**
0232 * GLIB_VERSION_2_42:
0233 *
0234 * A macro that evaluates to the 2.42 version of GLib, in a format
0235 * that can be used by the C pre-processor.
0236 *
0237 * Since: 2.42
0238 */
0239 #define GLIB_VERSION_2_42       (G_ENCODE_VERSION (2, 42))
0240 /**
0241 * GLIB_VERSION_2_44:
0242 *
0243 * A macro that evaluates to the 2.44 version of GLib, in a format
0244 * that can be used by the C pre-processor.
0245 *
0246 * Since: 2.44
0247 */
0248 #define GLIB_VERSION_2_44       (G_ENCODE_VERSION (2, 44))
0249 /**
0250 * GLIB_VERSION_2_46:
0251 *
0252 * A macro that evaluates to the 2.46 version of GLib, in a format
0253 * that can be used by the C pre-processor.
0254 *
0255 * Since: 2.46
0256 */
0257 #define GLIB_VERSION_2_46       (G_ENCODE_VERSION (2, 46))
0258 /**
0259 * GLIB_VERSION_2_48:
0260 *
0261 * A macro that evaluates to the 2.48 version of GLib, in a format
0262 * that can be used by the C pre-processor.
0263 *
0264 * Since: 2.48
0265 */
0266 #define GLIB_VERSION_2_48       (G_ENCODE_VERSION (2, 48))
0267 /**
0268 * GLIB_VERSION_2_50:
0269 *
0270 * A macro that evaluates to the 2.50 version of GLib, in a format
0271 * that can be used by the C pre-processor.
0272 *
0273 * Since: 2.50
0274 */
0275 #define GLIB_VERSION_2_50       (G_ENCODE_VERSION (2, 50))
0276 /**
0277 * GLIB_VERSION_2_52:
0278 *
0279 * A macro that evaluates to the 2.52 version of GLib, in a format
0280 * that can be used by the C pre-processor.
0281 *
0282 * Since: 2.52
0283 */
0284 #define GLIB_VERSION_2_52       (G_ENCODE_VERSION (2, 52))
0285 /**
0286 * GLIB_VERSION_2_54:
0287 *
0288 * A macro that evaluates to the 2.54 version of GLib, in a format
0289 * that can be used by the C pre-processor.
0290 *
0291 * Since: 2.54
0292 */
0293 #define GLIB_VERSION_2_54       (G_ENCODE_VERSION (2, 54))
0294 /**
0295 * GLIB_VERSION_2_56:
0296 *
0297 * A macro that evaluates to the 2.56 version of GLib, in a format
0298 * that can be used by the C pre-processor.
0299 *
0300 * Since: 2.56
0301 */
0302 #define GLIB_VERSION_2_56       (G_ENCODE_VERSION (2, 56))
0303 /**
0304 * GLIB_VERSION_2_58:
0305 *
0306 * A macro that evaluates to the 2.58 version of GLib, in a format
0307 * that can be used by the C pre-processor.
0308 *
0309 * Since: 2.58
0310 */
0311 #define GLIB_VERSION_2_58       (G_ENCODE_VERSION (2, 58))
0312 /**
0313 * GLIB_VERSION_2_60:
0314 *
0315 * A macro that evaluates to the 2.60 version of GLib, in a format
0316 * that can be used by the C pre-processor.
0317 *
0318 * Since: 2.60
0319 */
0320 #define GLIB_VERSION_2_60       (G_ENCODE_VERSION (2, 60))
0321 /**
0322 * GLIB_VERSION_2_62:
0323 *
0324 * A macro that evaluates to the 2.62 version of GLib, in a format
0325 * that can be used by the C pre-processor.
0326 *
0327 * Since: 2.62
0328 */
0329 #define GLIB_VERSION_2_62       (G_ENCODE_VERSION (2, 62))
0330 /**
0331 * GLIB_VERSION_2_64:
0332 *
0333 * A macro that evaluates to the 2.64 version of GLib, in a format
0334 * that can be used by the C pre-processor.
0335 *
0336 * Since: 2.64
0337 */
0338 #define GLIB_VERSION_2_64       (G_ENCODE_VERSION (2, 64))
0339 /**
0340 * GLIB_VERSION_2_66:
0341 *
0342 * A macro that evaluates to the 2.66 version of GLib, in a format
0343 * that can be used by the C pre-processor.
0344 *
0345 * Since: 2.66
0346 */
0347 #define GLIB_VERSION_2_66       (G_ENCODE_VERSION (2, 66))
0348 /**
0349 * GLIB_VERSION_2_68:
0350 *
0351 * A macro that evaluates to the 2.68 version of GLib, in a format
0352 * that can be used by the C pre-processor.
0353 *
0354 * Since: 2.68
0355 */
0356 #define GLIB_VERSION_2_68       (G_ENCODE_VERSION (2, 68))
0357 /**
0358 * GLIB_VERSION_2_70:
0359 *
0360 * A macro that evaluates to the 2.70 version of GLib, in a format
0361 * that can be used by the C pre-processor.
0362 *
0363 * Since: 2.70
0364 */
0365 #define GLIB_VERSION_2_70       (G_ENCODE_VERSION (2, 70))
0366 /**
0367 * GLIB_VERSION_2_72:
0368 *
0369 * A macro that evaluates to the 2.72 version of GLib, in a format
0370 * that can be used by the C pre-processor.
0371 *
0372 * Since: 2.72
0373 */
0374 #define GLIB_VERSION_2_72       (G_ENCODE_VERSION (2, 72))
0375 /**
0376 * GLIB_VERSION_2_74:
0377 *
0378 * A macro that evaluates to the 2.74 version of GLib, in a format
0379 * that can be used by the C pre-processor.
0380 *
0381 * Since: 2.74
0382 */
0383 #define GLIB_VERSION_2_74       (G_ENCODE_VERSION (2, 74))
0384 /**
0385 * GLIB_VERSION_2_76:
0386 *
0387 * A macro that evaluates to the 2.76 version of GLib, in a format
0388 * that can be used by the C pre-processor.
0389 *
0390 * Since: 2.76
0391 */
0392 #define GLIB_VERSION_2_76       (G_ENCODE_VERSION (2, 76))
0393 /**
0394 * GLIB_VERSION_2_78:
0395 *
0396 * A macro that evaluates to the 2.78 version of GLib, in a format
0397 * that can be used by the C pre-processor.
0398 *
0399 * Since: 2.78
0400 */
0401 #define GLIB_VERSION_2_78       (G_ENCODE_VERSION (2, 78))
0402 /**
0403 * GLIB_VERSION_2_80:
0404 *
0405 * A macro that evaluates to the 2.80 version of GLib, in a format
0406 * that can be used by the C pre-processor.
0407 *
0408 * Since: 2.80
0409 */
0410 #define GLIB_VERSION_2_80       (G_ENCODE_VERSION (2, 80))
0411 /**
0412 * GLIB_VERSION_2_82:
0413 *
0414 * A macro that evaluates to the 2.82 version of GLib, in a format
0415 * that can be used by the C pre-processor.
0416 *
0417 * Since: 2.82
0418 */
0419 #define GLIB_VERSION_2_82       (G_ENCODE_VERSION (2, 82))
0420 /**
0421 * GLIB_VERSION_2_84:
0422 *
0423 * A macro that evaluates to the 2.84 version of GLib, in a format
0424 * that can be used by the C pre-processor.
0425 *
0426 * Since: 2.84
0427 */
0428 #define GLIB_VERSION_2_84       (G_ENCODE_VERSION (2, 84))
0429 /**
0430 * GLIB_VERSION_2_86:
0431 *
0432 * A macro that evaluates to the 2.86 version of GLib, in a format
0433 * that can be used by the C pre-processor.
0434 *
0435 * Since: 2.86
0436 */
0437 #define GLIB_VERSION_2_86       (G_ENCODE_VERSION (2, 86))
0438 /**
0439 * GLIB_VERSION_2_88:
0440 *
0441 * A macro that evaluates to the 2.88 version of GLib, in a format
0442 * that can be used by the C pre-processor.
0443 *
0444 * Since: 2.88
0445 */
0446 #define GLIB_VERSION_2_88       (G_ENCODE_VERSION (2, 88))
0447 
0448 /**
0449  * GLIB_VERSION_CUR_STABLE:
0450  *
0451  * A macro that evaluates to the current stable version of GLib, in a format
0452  * that can be used by the C pre-processor.
0453  *
0454  * During an unstable development cycle, this evaluates to the next stable
0455  * (unreleased) version which will be the result of the development cycle.
0456  *
0457  * Since: 2.32
0458  */
0459 #if (GLIB_MINOR_VERSION % 2)
0460 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1))
0461 #else
0462 #define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION))
0463 #endif
0464 
0465 /**
0466  * GLIB_VERSION_PREV_STABLE:
0467  *
0468  * A macro that evaluates to the previous stable version of GLib, in a format
0469  * that can be used by the C pre-processor.
0470  *
0471  * During an unstable development cycle, this evaluates to the most recent
0472  * released stable release, which preceded this development cycle.
0473  *
0474  * Since: 2.32
0475  */
0476 #if (GLIB_MINOR_VERSION % 2)
0477 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1))
0478 #else
0479 #define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2))
0480 #endif
0481 
0482 /**
0483  * GLIB_VERSION_MIN_REQUIRED:
0484  *
0485  * A macro that should be defined by the user prior to including
0486  * the glib.h header.
0487  * The definition should be one of the predefined GLib version
0488  * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
0489  *
0490  * This macro defines the earliest version of GLib that the package is
0491  * required to be able to compile against.
0492  *
0493  * If the compiler is configured to warn about the use of deprecated
0494  * functions, then using functions that were deprecated in version
0495  * %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but
0496  * using functions deprecated in later releases will not).
0497  *
0498  * Since: 2.32
0499  */
0500 /* If the package sets GLIB_VERSION_MIN_REQUIRED to some future
0501  * GLIB_VERSION_X_Y value that we don't know about, it will compare as
0502  * 0 in preprocessor tests.
0503  */
0504 #ifndef GLIB_VERSION_MIN_REQUIRED
0505 #define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE)
0506 #elif GLIB_VERSION_MIN_REQUIRED == 0
0507 #undef GLIB_VERSION_MIN_REQUIRED
0508 #define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE + 2)
0509 #endif
0510 
0511 /**
0512  * GLIB_VERSION_MAX_ALLOWED:
0513  *
0514  * A macro that should be defined by the user prior to including
0515  * the glib.h header.
0516  * The definition should be one of the predefined GLib version
0517  * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
0518  *
0519  * This macro defines the latest version of the GLib API that the
0520  * package is allowed to make use of.
0521  *
0522  * If the compiler is configured to warn about the use of deprecated
0523  * functions, then using functions added after version
0524  * %GLIB_VERSION_MAX_ALLOWED will cause warnings.
0525  *
0526  * Unless you are using GLIB_CHECK_VERSION() or the like to compile
0527  * different code depending on the GLib version, then this should be
0528  * set to the same value as %GLIB_VERSION_MIN_REQUIRED.
0529  *
0530  * Since: 2.32
0531  */
0532 #if !defined(GLIB_VERSION_MAX_ALLOWED) || (GLIB_VERSION_MAX_ALLOWED == 0)
0533 #undef GLIB_VERSION_MAX_ALLOWED
0534 #define GLIB_VERSION_MAX_ALLOWED (GLIB_VERSION_CUR_STABLE)
0535 #endif
0536 
0537 /* sanity checks */
0538 #if GLIB_VERSION_MIN_REQUIRED > GLIB_VERSION_CUR_STABLE
0539 #error "GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE"
0540 #endif
0541 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED
0542 #error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED"
0543 #endif
0544 #if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_26
0545 #error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
0546 #endif
0547 
0548 #endif /*  __G_VERSION_MACROS_H__ */