/*
 * This file was generated automatically by ExtUtils::ParseXS version 3.34 from the
 * contents of GtkTreeSortable.xs. Do not edit this file, edit GtkTreeSortable.xs instead.
 *
 *    ANY CHANGES MADE HERE WILL BE LOST!
 *
 */

#line 1 "xs/GtkTreeSortable.xs"
/*
 * Copyright (c) 2003 by the gtk2-perl team (see the file AUTHORS)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the 
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
 * Boston, MA  02110-1301  USA.
 *
 * $Id$
 */

#include "gtk2perl.h"

/* ------------------------------------------------------------------------- */

#define PREP		\
	dSP;		\
	ENTER;		\
	SAVETMPS;	\
	PUSHMARK (SP);	\
	PUSHs (sv_2mortal (newSVGObject (G_OBJECT (sortable))));

#define CALL		\
	PUTBACK;	\
	call_sv ((SV *)GvCV (slot), G_VOID|G_DISCARD);

#define FINISH		\
	FREETMPS;	\
	LEAVE;

#define GET_METHOD(method)	\
	HV * stash = gperl_object_stash_from_type (G_OBJECT_TYPE (sortable)); \
	GV * slot = gv_fetchmethod (stash, method);

#define METHOD_EXISTS (slot && GvCV (slot))

/* ------------------------------------------------------------------------- */

static gboolean
gtk2perl_tree_sortable_get_sort_column_id (GtkTreeSortable *sortable,
                                           gint            *sort_column_id,
                                           GtkSortType     *order)
{
	gboolean retval = FALSE;
	gint real_sort_column_id;
	GtkSortType real_order;
	GET_METHOD ("GET_SORT_COLUMN_ID");

	if (METHOD_EXISTS) {
		PREP;
		PUTBACK;

		if (3 != call_sv ((SV *) GvCV (slot), G_ARRAY))
			croak ("GET_SORT_COLUMN_ID must return a boolean "
			       "indicating whether the column is not special, "
			       "the sort column id and the sort order");

		SPAGAIN;

		real_order = SvGtkSortType (POPs);
		real_sort_column_id = POPi;
		retval = POPu;

		PUTBACK;
		FINISH;

		if (sort_column_id)
			*sort_column_id = real_sort_column_id;
		if (order)
			*order = real_order;
	}

	return retval;
}

/* ------------------------------------------------------------------------- */

static void
gtk2perl_tree_sortable_set_sort_column_id (GtkTreeSortable *sortable,
                                           gint             sort_column_id,
                                           GtkSortType      order)
{
	GET_METHOD ("SET_SORT_COLUMN_ID");

	if (METHOD_EXISTS) {
		PREP;
		XPUSHs (sv_2mortal (newSViv (sort_column_id)));
		XPUSHs (sv_2mortal (newSVGtkSortType (order)));
		CALL;
		FINISH;
	}
}

/* ------------------------------------------------------------------------- */

/* The strategy: Put the given function pointer, user data and destruction
 * notification pointer into a struct.  Make an IV SV pointing to that struct.
 * Create a blessed reference around this SV which has &{} overloading.  When
 * the Perl programmer then invokes this SV, we recreate every necessary bit in
 * the invoke handler and call the C function. */

typedef struct {
	GtkTreeIterCompareFunc func;
	gpointer data;
	GtkDestroyNotify destroy;
} Gtk2PerlTreeIterCompareFunc;

static void
create_callback (GtkTreeIterCompareFunc func,
                 gpointer               data,
                 GtkDestroyNotify       destroy,
		 SV                   **code_return,
                 SV                   **data_return)
{
	HV *stash;
	SV *code_sv, *data_sv;
	Gtk2PerlTreeIterCompareFunc *stuff;

	stuff = g_new0 (Gtk2PerlTreeIterCompareFunc, 1);
	stuff->func = func;
	stuff->data = data;
	stuff->destroy = destroy;
	data_sv = newSViv (PTR2IV (stuff));

	stash = gv_stashpv ("Gtk2::TreeSortable::IterCompareFunc", TRUE);
	code_sv = sv_bless (newRV (data_sv), stash);

	*code_return = code_sv;
	*data_return = data_sv;
}

static void
gtk2perl_tree_sortable_set_sort_func (GtkTreeSortable       *sortable,
                                      gint                   sort_column_id,
                                      GtkTreeIterCompareFunc func,
                                      gpointer               data,
                                      GtkDestroyNotify       destroy)
{
	GET_METHOD ("SET_SORT_FUNC");

	if (METHOD_EXISTS) {
		SV *code, *my_data;
		PREP;

		create_callback (func, data, destroy, &code, &my_data);

		XPUSHs (sv_2mortal (newSViv (sort_column_id)));
		XPUSHs (sv_2mortal (code));
		XPUSHs (sv_2mortal (my_data));

		CALL;

		FINISH;
	}
}

static void
gtk2perl_tree_sortable_set_default_sort_func (GtkTreeSortable       *sortable,
                                              GtkTreeIterCompareFunc func,
                                              gpointer               data,
                                              GtkDestroyNotify       destroy)
{
	GET_METHOD ("SET_DEFAULT_SORT_FUNC");

	if (METHOD_EXISTS) {
		SV *code, *my_data;
		PREP;

		create_callback (func, data, destroy, &code, &my_data);

		XPUSHs (sv_2mortal (newSVsv (code)));
		XPUSHs (sv_2mortal (newSVsv (my_data)));

		CALL;

		FINISH;
	}
}

/* ------------------------------------------------------------------------- */

static gboolean
gtk2perl_tree_sortable_has_default_sort_func (GtkTreeSortable *sortable)
{
	gboolean retval = FALSE;
	GET_METHOD ("HAS_DEFAULT_SORT_FUNC");

	if (METHOD_EXISTS) {
		PREP;
		PUTBACK;

		if (1 != call_sv ((SV *) GvCV (slot), G_SCALAR))
			croak ("HAS_DEFAULT_SORT_FUNC must return a boolean");

		SPAGAIN;

		retval = POPu;

		PUTBACK;
		FINISH;
	}

	return retval;
}

/* ------------------------------------------------------------------------- */

static void
gtk2perl_tree_sortable_init (GtkTreeSortableIface * iface)
{
	iface->get_sort_column_id = gtk2perl_tree_sortable_get_sort_column_id;
	iface->set_sort_column_id = gtk2perl_tree_sortable_set_sort_column_id;
	iface->set_sort_func = gtk2perl_tree_sortable_set_sort_func;
	iface->set_default_sort_func = gtk2perl_tree_sortable_set_default_sort_func;
	iface->has_default_sort_func = gtk2perl_tree_sortable_has_default_sort_func;
}

/* ------------------------------------------------------------------------- */

static GPerlCallback *
new_sort_func (SV * sort_func, SV * user_data)
{
	GType param_types[3];
	param_types[0] = GTK_TYPE_TREE_MODEL;
	param_types[1] = GTK_TYPE_TREE_ITER;
	param_types[2] = GTK_TYPE_TREE_ITER;
	return gperl_callback_new (sort_func, user_data,
	                           3, param_types, G_TYPE_INT);
}

static gint
gtk2perl_tree_iter_compare_func (GtkTreeModel *model,
                                 GtkTreeIter *a,
                                 GtkTreeIter *b,
                                 gpointer user_data)
{
	gint ret;
	GValue retval = {0,};
	GPerlCallback * callback = (GPerlCallback*) user_data;

	g_value_init (&retval, callback->return_type);
	gperl_callback_invoke (callback, &retval, model, a, b);
	ret = g_value_get_int (&retval);
	g_value_unset (&retval);

	return ret;
}

/* ------------------------------------------------------------------------- */

#line 271 "xs/GtkTreeSortable.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef dVAR
#  define dVAR		dNOOP
#endif


/* This stuff is not part of the API! You have been warned. */
#ifndef PERL_VERSION_DECIMAL
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
#  define PERL_DECIMAL_VERSION \
	  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
#  define PERL_VERSION_GE(r,v,s) \
	  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
#  define PERL_VERSION_LE(r,v,s) \
	  (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

/* XS_INTERNAL is the explicit static-linkage variant of the default
 * XS macro.
 *
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
 * for anything but the BOOT XSUB.
 *
 * See XSUB.h in core!
 */


/* TODO: This might be compatible further back than 5.10.0. */
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
#  undef XS_EXTERNAL
#  undef XS_INTERNAL
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
#  endif
#  if defined(__SYMBIAN32__)
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
#  endif
#  ifndef XS_EXTERNAL
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#    else
#      ifdef __cplusplus
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
#        define XS_INTERNAL(name) static XSPROTO(name)
#      else
#        define XS_EXTERNAL(name) XSPROTO(name)
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
#      endif
#    endif
#  endif
#endif

/* perl >= 5.10.0 && perl <= 5.15.1 */


/* The XS_EXTERNAL macro is used for functions that must not be static
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
 * macro defined, the best we can do is assume XS is the same.
 * Dito for XS_INTERNAL.
 */
#ifndef XS_EXTERNAL
#  define XS_EXTERNAL(name) XS(name)
#endif
#ifndef XS_INTERNAL
#  define XS_INTERNAL(name) XS(name)
#endif

/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
 * internal macro that we're free to redefine for varying linkage due
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
 */

#undef XS_EUPXS
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
#  define XS_EUPXS(name) XS_EXTERNAL(name)
#else
   /* default to internal */
#  define XS_EUPXS(name) XS_INTERNAL(name)
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
	    Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
        else
	    Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
	Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#define croak_xs_usage        S_croak_xs_usage

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#if PERL_VERSION_LE(5, 21, 5)
#  define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
#else
#  define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
#endif

#line 415 "xs/GtkTreeSortable.c"

XS_EUPXS(XS_Gtk2__TreeSortable__ADD_INTERFACE); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable__ADD_INTERFACE)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, target_class");
    {
	const char *	target_class = (const char *)SvPV_nolen(ST(1))
;
#line 331 "xs/GtkTreeSortable.xs"
    {
	static const GInterfaceInfo iface_info = {
		(GInterfaceInitFunc) gtk2perl_tree_sortable_init,
		(GInterfaceFinalizeFunc) NULL,
		(gpointer) NULL
	};
	GType gtype = gperl_object_type_from_package (target_class);
	g_type_add_interface_static (gtype, GTK_TYPE_TREE_SORTABLE,
	                &iface_info);
    }
#line 437 "xs/GtkTreeSortable.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TreeSortable_sort_column_changed); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable_sort_column_changed)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "sortable");
    {
	GtkTreeSortable *	sortable = SvGtkTreeSortable (ST(0))
;

	gtk_tree_sortable_sort_column_changed(sortable);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TreeSortable_get_sort_column_id); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable_get_sort_column_id)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "sortable");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GtkTreeSortable *	sortable = SvGtkTreeSortable (ST(0))
;
#line 360 "xs/GtkTreeSortable.xs"
	gint sort_column_id;
	GtkSortType order;
#line 473 "xs/GtkTreeSortable.c"
#line 363 "xs/GtkTreeSortable.xs"
	PUTBACK;
	if (!gtk_tree_sortable_get_sort_column_id (sortable, &sort_column_id,
	                                           &order))
		XSRETURN_EMPTY;
	SPAGAIN;
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSViv (sort_column_id)));
	PUSHs (sv_2mortal (newSVGtkSortType (order)));
#line 483 "xs/GtkTreeSortable.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__TreeSortable_set_sort_column_id); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable_set_sort_column_id)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "sortable, sort_column_id, order");
    {
	GtkTreeSortable *	sortable = SvGtkTreeSortable (ST(0))
;
	gint	sort_column_id = (gint)SvIV(ST(1))
;
	GtkSortType	order = SvGtkSortType (ST(2))
;

	gtk_tree_sortable_set_sort_column_id(sortable, sort_column_id, order);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TreeSortable_set_sort_func); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable_set_sort_func)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "sortable, sort_column_id, sort_func, user_data=NULL");
    {
	GtkTreeSortable *	sortable = SvGtkTreeSortable (ST(0))
;
	gint	sort_column_id = (gint)SvIV(ST(1))
;
	SV *	sort_func = ST(2)
;
	SV *	user_data;

	if (items < 4)
	    user_data = NULL;
	else {
	    user_data = ST(3)
;
	}
#line 387 "xs/GtkTreeSortable.xs"
	gtk_tree_sortable_set_sort_func (sortable, sort_column_id,
	                                 gtk2perl_tree_iter_compare_func,
	                                 new_sort_func (sort_func, user_data),
	                                 (GtkDestroyNotify)
	                                       gperl_callback_destroy);
#line 537 "xs/GtkTreeSortable.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TreeSortable_set_default_sort_func); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable_set_default_sort_func)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "sortable, sort_func, user_data=NULL");
    {
	GtkTreeSortable *	sortable = SvGtkTreeSortable (ST(0))
;
	SV *	sort_func = ST(1)
;
	SV *	user_data;

	if (items < 3)
	    user_data = NULL;
	else {
	    user_data = ST(2)
;
	}
#line 400 "xs/GtkTreeSortable.xs"
	if (!gperl_sv_is_defined (sort_func)) {
		gtk_tree_sortable_set_default_sort_func
					(sortable, NULL, NULL, NULL);
	} else {
		gtk_tree_sortable_set_default_sort_func
				(sortable, 
				 gtk2perl_tree_iter_compare_func,
		                 new_sort_func (sort_func, user_data),
				 (GtkDestroyNotify) gperl_callback_destroy);
	}
#line 573 "xs/GtkTreeSortable.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TreeSortable_has_default_sort_func); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable_has_default_sort_func)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "sortable");
    {
	GtkTreeSortable *	sortable = SvGtkTreeSortable (ST(0))
;
	gboolean	RETVAL;

	RETVAL = gtk_tree_sortable_has_default_sort_func(sortable);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TreeSortable__IterCompareFunc_invoke); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable__IterCompareFunc_invoke)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "code, model, a, b, data");
    {
	SV *	code = ST(0)
;
	GtkTreeModel *	model = SvGtkTreeModel (ST(1))
;
	GtkTreeIter *	a = SvGtkTreeIter (ST(2))
;
	GtkTreeIter *	b = SvGtkTreeIter (ST(3))
;
#line 427 "xs/GtkTreeSortable.xs"
	Gtk2PerlTreeIterCompareFunc *stuff;
#line 614 "xs/GtkTreeSortable.c"
	gint	RETVAL;
	dXSTARG;
#line 429 "xs/GtkTreeSortable.xs"
	stuff = INT2PTR (Gtk2PerlTreeIterCompareFunc*, SvIV (SvRV (code)));
	if (!stuff || !stuff->func)
		croak ("Invalid reference encountered in iter compare func");
	RETVAL = stuff->func (model, a, b, stuff->data);
#line 622 "xs/GtkTreeSortable.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TreeSortable__IterCompareFunc_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TreeSortable__IterCompareFunc_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "code");
    {
	SV *	code = ST(0)
;
#line 440 "xs/GtkTreeSortable.xs"
	Gtk2PerlTreeIterCompareFunc *stuff;
#line 640 "xs/GtkTreeSortable.c"
#line 442 "xs/GtkTreeSortable.xs"
	if (!gperl_sv_is_defined (code) || !SvROK (code))
		return;
	stuff = INT2PTR (Gtk2PerlTreeIterCompareFunc*, SvIV (SvRV (code)));
	if (stuff && stuff->destroy)
		stuff->destroy (stuff->data);
	if (stuff)
		g_free (stuff);
#line 649 "xs/GtkTreeSortable.c"
    }
    XSRETURN_EMPTY;
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Gtk2__TreeSortable); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Gtk2__TreeSortable)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(file);

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#if PERL_VERSION_LE(5, 21, 5)
    XS_VERSION_BOOTCHECK;
#  ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#  endif
#endif

        newXS_deffile("Gtk2::TreeSortable::_ADD_INTERFACE", XS_Gtk2__TreeSortable__ADD_INTERFACE);
        newXS_deffile("Gtk2::TreeSortable::sort_column_changed", XS_Gtk2__TreeSortable_sort_column_changed);
        newXS_deffile("Gtk2::TreeSortable::get_sort_column_id", XS_Gtk2__TreeSortable_get_sort_column_id);
        newXS_deffile("Gtk2::TreeSortable::set_sort_column_id", XS_Gtk2__TreeSortable_set_sort_column_id);
        newXS_deffile("Gtk2::TreeSortable::set_sort_func", XS_Gtk2__TreeSortable_set_sort_func);
        newXS_deffile("Gtk2::TreeSortable::set_default_sort_func", XS_Gtk2__TreeSortable_set_default_sort_func);
        newXS_deffile("Gtk2::TreeSortable::has_default_sort_func", XS_Gtk2__TreeSortable_has_default_sort_func);
        newXS_deffile("Gtk2::TreeSortable::IterCompareFunc::invoke", XS_Gtk2__TreeSortable__IterCompareFunc_invoke);
        newXS_deffile("Gtk2::TreeSortable::IterCompareFunc::DESTROY", XS_Gtk2__TreeSortable__IterCompareFunc_DESTROY);
#if PERL_VERSION_LE(5, 21, 5)
#  if PERL_VERSION_GE(5, 9, 0)
    if (PL_unitcheckav)
        call_list(PL_scopestack_ix, PL_unitcheckav);
#  endif
    XSRETURN_YES;
#else
    Perl_xs_boot_epilog(aTHX_ ax);
#endif
}

