ifndef __G_VERSION_MACROS_H__
define __G_VERSION_MACROS_H__

if NOT defined (__GLIB_H_INSIDE__) AND NOT defined (GLIB_COMPILATION)
.err <"Only glib.h can be included directly.">
endif

G_ENCODE_VERSION macro major, minor
%	exitm<@CatStr(%((major SHL 16) OR (minor SHL 8)))>
	endm

define GLIB_VERSION_2_26	G_ENCODE_VERSION(2, 26)
define GLIB_VERSION_2_28	G_ENCODE_VERSION(2, 28)
define GLIB_VERSION_2_30	G_ENCODE_VERSION(2, 30)
define GLIB_VERSION_2_32	G_ENCODE_VERSION(2, 32)
define GLIB_VERSION_2_34	G_ENCODE_VERSION(2, 34)
define GLIB_VERSION_2_36	G_ENCODE_VERSION(2, 36)
define GLIB_VERSION_2_38	G_ENCODE_VERSION(2, 38)
define GLIB_VERSION_2_40	G_ENCODE_VERSION(2, 40)
define GLIB_VERSION_2_42	G_ENCODE_VERSION(2, 42)
define GLIB_VERSION_2_44	G_ENCODE_VERSION(2, 44)
define GLIB_VERSION_2_46	G_ENCODE_VERSION(2, 46)
define GLIB_VERSION_2_48	G_ENCODE_VERSION(2, 48)
define GLIB_VERSION_2_50	G_ENCODE_VERSION(2, 50)
define GLIB_VERSION_2_52	G_ENCODE_VERSION(2, 52)
define GLIB_VERSION_2_54	G_ENCODE_VERSION(2, 54)
define GLIB_VERSION_2_56	G_ENCODE_VERSION(2, 56)
define GLIB_VERSION_2_58	G_ENCODE_VERSION(2, 58)
define GLIB_VERSION_2_60	G_ENCODE_VERSION(2, 60)
define GLIB_VERSION_2_62	G_ENCODE_VERSION(2, 62)
define GLIB_VERSION_2_64	G_ENCODE_VERSION(2, 64)
define GLIB_VERSION_2_66	G_ENCODE_VERSION(2, 66)
define GLIB_VERSION_2_68	G_ENCODE_VERSION(2, 68)
define GLIB_VERSION_2_70	G_ENCODE_VERSION(2, 70)
define GLIB_VERSION_2_72	G_ENCODE_VERSION(2, 72)

if (GLIB_MINOR_VERSION mod 2)
define GLIB_VERSION_CUR_STABLE	G_ENCODE_VERSION(GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1)
else
define GLIB_VERSION_CUR_STABLE	G_ENCODE_VERSION(GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION)
endif

if (GLIB_MINOR_VERSION mod 2)
define GLIB_VERSION_PREV_STABLE G_ENCODE_VERSION(GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1)
else
define GLIB_VERSION_PREV_STABLE G_ENCODE_VERSION(GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2)
endif

ifndef GLIB_VERSION_MIN_REQUIRED
define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_CUR_STABLE
elseif GLIB_VERSION_MIN_REQUIRED eq 0
undef  GLIB_VERSION_MIN_REQUIRED
define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE + 2)
endif

ifndef GLIB_VERSION_MAX_ALLOWED
define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_CUR_STABLE
endif

if GLIB_VERSION_MIN_REQUIRED gt GLIB_VERSION_CUR_STABLE
.err <"GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE">
endif
if GLIB_VERSION_MAX_ALLOWED lt GLIB_VERSION_MIN_REQUIRED
.err <"GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED">
endif
if GLIB_VERSION_MIN_REQUIRED lt GLIB_VERSION_2_26
.err <"GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26">
endif

endif
