Sprout/sprout/compost/load/source.hpp

73 lines
2.4 KiB
C++
Raw Normal View History

#ifndef COMPOST_DEF_LOAD_SOURCE_IDENTIFIER
# error should define COMPOST_DEF_LOAD_SOURCE_IDENTIFIER.
#endif
#ifndef COMPOST_DEF_LOAD_SOURCE_FILE
# error should define COMPOST_DEF_LOAD_SOURCE_FILE.
#endif
#define COMPOST_LOAD_IDENTIFIER_DETAIL_CAT(id, suffix) COMPOST_LOAD_IDENTIFIER_DETAIL_CAT_I(id, suffix)
#define COMPOST_LOAD_IDENTIFIER_DETAIL_CAT_I(id, suffix) COMPOST_LOAD_IDENTIFIER_DETAIL_CAT_II(id ## suffix)
#define COMPOST_LOAD_IDENTIFIER_DETAIL_CAT_II(res) res
#define COMPOST_LOAD_DETAIL_IDENTIFIER(id) COMPOST_LOAD_IDENTIFIER_DETAIL_CAT( \
COMPOST_LOAD_IDENTIFIER_DETAIL_CAT(COMPOST_DEF_LOAD_SOURCE_IDENTIFIER, id), \
_compost_load_source_detail \
)
#define COMPOST_LOAD_IDENTIFIER COMPOST_DEF_LOAD_SOURCE_IDENTIFIER
#ifdef COMPOST_DEF_LOAD_INFO_IDENTIFIER
# define COMPOST_LOAD_INFO_IDENTIFIER COMPOST_DEF_LOAD_INFO_IDENTIFIER
#else
# define COMPOST_LOAD_INFO_IDENTIFIER COMPOST_LOAD_DETAIL_IDENTIFIER(info)
#endif
2012-12-02 08:06:37 +00:00
#ifdef COMPOST_DEF_LOAD_SOURCE_INDEX
# define COMPOST_LOAD_SOURCE_INDEX COMPOST_DEF_LOAD_SOURCE_INDEX
#else
# define COMPOST_LOAD_SOURCE_INDEX 0
#endif
SPROUT_STATIC_CONSTEXPR sprout::compost::sources::version_type COMPOST_LOAD_DETAIL_IDENTIFIER(version) =
# define COMPOST_LOADING_SOURCE_VERSION
# include COMPOST_DEF_LOAD_SOURCE_FILE
# undef COMPOST_LOADING_SOURCE_VERSION
;
static_assert(COMPOST_LOAD_DETAIL_IDENTIFIER(version) <= 0, "Unsupported compost src version");
SPROUT_STATIC_CONSTEXPR sprout::compost::sources::info_type COMPOST_LOAD_INFO_IDENTIFIER = {
# define COMPOST_LOADING_SOURCE_INFO
# include COMPOST_DEF_LOAD_SOURCE_FILE
# undef COMPOST_LOADING_SOURCE_INFO
};
SPROUT_STATIC_CONSTEXPR sprout::compost::sources::sound_type<
COMPOST_LOAD_INFO_IDENTIFIER.size
> COMPOST_LOAD_IDENTIFIER(
COMPOST_LOAD_INFO_IDENTIFIER,
# define COMPOST_LOADING_SOURCE_DATA
# include COMPOST_DEF_LOAD_SOURCE_FILE
# undef COMPOST_LOADING_SOURCE_DATA
);
#undef COMPOST_LOAD_IDENTIFIER
#undef COMPOST_LOAD_INFO_IDENTIFIER
2012-12-02 08:06:37 +00:00
#undef COMPOST_LOAD_SOURCE_INDEX
#undef COMPOST_LOAD_DETAIL_IDENTIFIER
#undef COMPOST_LOAD_IDENTIFIER_DETAIL_CAT
#undef COMPOST_LOAD_IDENTIFIER_DETAIL_CAT_I
#undef COMPOST_LOAD_IDENTIFIER_DETAIL_CAT_II
#undef COMPOST_DEF_LOAD_SOURCE_IDENTIFIER
#undef COMPOST_DEF_LOAD_SOURCE_FILE
#ifdef COMPOST_DEF_LOAD_INFO_IDENTIFIER
# undef COMPOST_DEF_LOAD_INFO_IDENTIFIER
#endif
2012-12-02 08:06:37 +00:00
#ifdef COMPOST_DEF_LOAD_SOURCE_INDEX
# undef COMPOST_DEF_LOAD_SOURCE_INDEX
#endif