X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=codegen%2Fcodegen-stubhead.hxx;h=171d3990f6c5166401cbb274f4ced5404bbb34b6;hp=fa9947fec305b6e4003c928d0052fe3b725fd00c;hb=15980b02dac194a6f0dddce9c1750d914d97aa71;hpb=d5b431f83d0e215a590b3ec4df8ef5f212004960 diff --git a/codegen/codegen-stubhead.hxx b/codegen/codegen-stubhead.hxx index fa9947f..171d399 100644 --- a/codegen/codegen-stubhead.hxx +++ b/codegen/codegen-stubhead.hxx @@ -12,16 +12,41 @@ #include #ifdef __GCCXML__ -#define LIBT2N_SET_DEFAULTGROUP(x) namespace { typedef __attribute((gccxml("libt2n-"#x))) int libt2n_default_group; } -/* not allowed anymore -#define LIBT2N_SET_DEFAULTGROUP(x) #define LIBT2N_EXPORT __attribute((gccxml("libt2n-"#x))) +// used during parsing run with gccxml + +/** @brief mark a function to export it via libt2n + @par Example + @code + LIBT2N_EXPORT std::string testfunc(const std::string &str) + { + // your code here + } + @endcode */ #define LIBT2N_EXPORT __attribute((gccxml("libt2n-default"))) -#define LIBT2N_EXPORT_GROUP(group) __attribute((gccxml("libt2n-"#group))) + + +/** @brief tell libt2n about a default argument + @param type type of the default argument + @param value default value + @par Example + @code + LIBT2N_EXPORT std::string testfunc(LIBT2N_DEFAULT_ARG(const std::string str&,"hello world")) + { + // your code here + } + @endcode + @remarks Codegen gets default arguments via this define (gccxml-attribute) because gccxml + does not correctly output them (e.g. the namespace is ambiguous) +*/ +#define LIBT2N_DEFAULT_ARG(type,value) __attribute((gccxml("libt2n-default-arg",#value))) type = value + #else -#define LIBT2N_SET_DEFAULTGROUP(x) +// used during regular compile + #define LIBT2N_EXPORT -#define LIBT2N_EXPORT_GROUP(group) +#define LIBT2N_DEFAULT_ARG(type,value) type = value + #endif #endif