diff --git a/docs/reference/glib/tmpl/macros_misc.sgml b/docs/reference/glib/tmpl/macros_misc.sgml index 2396e5da4..b8f229d28 100644 --- a/docs/reference/glib/tmpl/macros_misc.sgml +++ b/docs/reference/glib/tmpl/macros_misc.sgml @@ -100,18 +100,49 @@ does not include string.h for you. Accepts a macro or a string and converts it into a string after -preprocessor argument expansion. +preprocessor argument expansion. For example, the following code: + +#define AGE 27 +const gchar *greeting = G_STRINGIFY (AGE) " today!"; + + + +is transformed by the preprocessor into (code equivalent to): + + + +const gchar *greeting = "27 today!"; + + @macro_or_string: a macro or a string. -Yields a new preprocessor pasted identifier 'identifier1identifier2' -from its expanded arguments 'identifier1' and 'identifier2'. +Yields a new preprocessor pasted identifier identifier1identifier2 +from its expanded arguments @identifier1 and @identifier2. For example, the +following code: + +#define GET(traveller,method) G_PASTE(traveller_get_, method) (traveller) +const gchar *name = GET (traveller, name); +const gchar *quest = GET (traveller, quest); +GdkColor *favourite = GET (traveller, favourite_colour); + + + +is transformed by the preprocessor into: + + + +const gchar *name = traveller_get_name (traveller); +const gchar *quest = traveller_get_quest (traveller); +GdkColor *favourite = traveller_get_favourite_colour (traveller); + + @identifier1: an identifier @identifier2: an identifier @Since: 2.20