This little piece of seemingly useless C may not seem like a bright idea, but it can be useful when you want to make a macro appear more like a function.

Observe the following example:

	#define FOO() {		\
		foo();		\
		bar();		\
	}

	...

	if( bort )
		FOO();
	else
		bam = bob;

This gets preprocessed as:

	if( bort )
	{
		foo();
		bar();
	};
	else
		bam = bob;

Note semicolon after the end of the block, giving us a glaring parse error! Oh no!

But if we use this weird/clever hack:

	#define FOO()		\
		do {		\
			foo();	\
			bar();	\
		} while(0)

We get:

	if( bort )
		do {
			foo();
			bar();
		} while(0);
	else
		bam = bob;

Which gives us the intended result, and keeps our compiler happy, thus saving the day. Sure, an unnecessary Boolean test is done, but what're you gonna do?

Of course, the problem wouldn't exist in the first place, had we inline functions.