Skip to content

Instantly share code, notes, and snippets.

@sw17ch
Created February 15, 2012 14:23
Show Gist options
  • Save sw17ch/1836072 to your computer and use it in GitHub Desktop.
Save sw17ch/1836072 to your computer and use it in GitHub Desktop.
#include "interface.h"
void initialize(void)
{
puts("Common Initialize\n");
#if defined(PLATFORM_A)
puts("Initialize A\n");
#elif defined(PLATFORM_B)
puts("Initialize B\n");
#else
#error "Invalid platform."
#endif
}
void do_stuff(void)
{
puts("Common Do Stuff\n");
#if defined(PLATFORM_A)
puts("Do Stuff A\n");
#elif defined(PLATFORM_B)
puts("Do Stuff B\n");
#else
#error "Invalid platform."
#endif
}
void cleanup(void)
{
puts("Common Cleanup\n");
#if defined(PLATFORM_A)
puts("Cleanup A\n");
#elif defined(PLATFORM_B)
puts("Cleanup B\n");
#else
#error "Invalid platform."
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment