I had no idea what this might be either (although now that I know, I'm telling myself that I could probably have guessed), but all it took to find out was entering G_STMT_START
into Google and clicking on the first result.
That page, documentation from the Glib manual, reveals that it is a macro designed to be used within multi-statement macros.
G_STMT_START
#define G_STMT_START
Used within multi-statement macros so that they can be used in places where only one statement is expected by the compiler.
G_STMT_END
#define G_STMT_END
Used within multi-statement macros so that they can be used in places where only one statement is expected by the compiler.
Later on in the search results, you'll get one or more copies of the gmacros.h
header file, where these macros are actually defined:
/* Provide simple macro statement wrappers (adapted from Perl):
* G_STMT_START { statements; } G_STMT_END;
* can be used as a single statement, as in
* if (x) G_STMT_START { ... } G_STMT_END; else ...
*
* For gcc we will wrap the statements within `({' and `})' braces.
* For SunOS they will be wrapped within `if (1)' and `else (void) 0',
* and otherwise within `do' and `while (0)'.
*/
#if !(defined (G_STMT_START) && defined (G_STMT_END))
# if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
# define G_STMT_START (void) __extension__ (
# define G_STMT_END )
# else
# if (defined (sun) || defined (__sun__))
# define G_STMT_START if (1)
# define G_STMT_END else (void)0
# else
# define G_STMT_START do
# define G_STMT_END while (0)
# endif
# endif
#endif
From that, it becomes pretty clear that these macros are just implementing the standard idiom, except on GCC where they use the extension intended for precisely this purpose.
I'd figure that there will be other parts of the GIMP code that will depend on the Glib headers, so you'll probably want to include them if you're using its code. But if not, there's enough information here to implement the relevant portions of code yourself.