[m-dev.] [Q] rtti_name_c_type question

Peter Ross petdr at cs.mu.OZ.AU
Sat Jun 24 00:27:14 AEST 2000


Hi,

Below is the generated RTTI info for the type
:- type t1 ---> t1.

The definitions for mercury_data_type__enum_name_ordered_t1_0 and
mercury_data_type__enum_value_ordered_t1_0 should be 

static const MR_EnumFunctorDesc * mercury_data_type__enum_name_ordered_t1_0[1];
static const MR_EnumFunctorDesc * mercury_data_type__enum_value_ordered_t1_0[1];

when compiling with the Microsoft Visual C++ compiler (the difference is
that the array size is made explicit).

Seeing that rtti_name_c_type is what generates this information, what is
the best way to get the size of the array, particulary for things like
du_ptag_ordered_table?

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

extern const struct MR_TypeCtorInfo_Struct mercury_data_type__type_ctor_info_t1_0;
static const MR_EnumFunctorDesc * mercury_data_type__enum_name_ordered_t1_0[];
static const MR_EnumFunctorDesc * mercury_data_type__enum_value_ordered_t1_0[];
static const MR_EnumFunctorDesc mercury_data_type__enum_functor_desc_t1_0_0;
static const MR_EnumFunctorDesc * mercury_data_type__enum_name_ordered_t1_0[];
static const MR_EnumFunctorDesc * mercury_data_type__enum_value_ordered_t1_0[];

const struct MR_TypeCtorInfo_Struct mercury_data_type__type_ctor_info_t1_0 = {
	0,
	MR_MAYBE_STATIC_CODE(ENTRY(mercury____Unify___type__t1_0_0)),
	MR_MAYBE_STATIC_CODE(ENTRY(mercury____Unify___type__t1_0_0)),
	MR_MAYBE_STATIC_CODE(ENTRY(mercury____Compare___type__t1_0_0)),
	MR_TYPECTOR_REP_ENUM,
	NULL,
	NULL,
	"type",
	"t1",
	4,
	{ (void *) mercury_data_type__enum_name_ordered_t1_0 },
	{ (void *) mercury_data_type__enum_value_ordered_t1_0 },
	1,
	-1
};

static const MR_EnumFunctorDesc * mercury_data_type__enum_name_ordered_t1_0[] = {
	&mercury_data_type__enum_functor_desc_t1_0_0
};

static const MR_EnumFunctorDesc * mercury_data_type__enum_value_ordered_t1_0[] = {
	&mercury_data_type__enum_functor_desc_t1_0_0
};

static const MR_EnumFunctorDesc mercury_data_type__enum_functor_desc_t1_0_0 = {
	"t",
	0
};
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list