Skip to content

Instantly share code, notes, and snippets.

@pghalliday
pghalliday / FailsToExpand.c
Created June 23, 2012 11:20
Macro Pasting Hell
#define CALLONE(FUNCTION, ARGS...) FUNCTION(1 , ##ARGS)
CALLONE(add, CALLONE(addOne));
/* expands to */
add(1, CALLONE(addOne));
#define MY_MACRO(FUNCTION_NAME, FORMAT, ARGS...) FUNCTION_NAME(FORMAT , ##ARGS)
@pghalliday
pghalliday / Main.c
Created June 16, 2012 10:00
Object Oriented OCode Boiler Plate
#include "opentv.h"
#include "assert.h"
#include "MyClass.h"
/* This method just waits for a quit message and then exits the application */
static void Main_waitToExit(void)
{
while (TRUE)
{