Deal with GLIB_VERSION_MIN_REQUIRED/MAX_ALLOWED being a "future" value

If GLIB_VERSION_MIN_REQUIRED or GLIB_VERSION_MAX_ALLOWED was defined
to a future value, we were essentially treating it as
GLIB_VERSION_0_0. Fix to treat it as being in the future instead.

https://bugzilla.gnome.org/show_bug.cgi?id=674898
This commit is contained in:
Dan Winship 2012-04-26 11:08:23 -04:00
parent 4ac0d78d5d
commit 40f0f66151

View File

@ -119,8 +119,15 @@
*
* Since: 2.32
*/
/* If the package sets GLIB_VERSION_MIN_REQUIRED to some future
* GLIB_VERSION_X_Y value that we don't know about, it will compare as
* 0 in preprocessor tests.
*/
#ifndef GLIB_VERSION_MIN_REQUIRED
# define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE)
#elif GLIB_VERSION_MIN_REQUIRED == 0
# undef GLIB_VERSION_MIN_REQUIRED
# define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE + 2)
#endif
/**
@ -139,11 +146,15 @@
*
* Since: 2.32
*/
#ifndef GLIB_VERSION_MAX_ALLOWED
# define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_CUR_STABLE
#if !defined (GLIB_VERSION_MAX_ALLOWED) || (GLIB_VERSION_MAX_ALLOWED == 0)
# undef GLIB_VERSION_MAX_ALLOWED
# define GLIB_VERSION_MAX_ALLOWED (GLIB_VERSION_CUR_STABLE)
#endif
/* sanity checks */
#if GLIB_VERSION_MIN_REQUIRED > GLIB_VERSION_CUR_STABLE
#error "GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE"
#endif
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED
#error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED"
#endif