Skip to content

Instantly share code, notes, and snippets.

@gerdr
Created February 10, 2012 13:06
Show Gist options
  • Save gerdr/1789578 to your computer and use it in GitHub Desktop.
Save gerdr/1789578 to your computer and use it in GitHub Desktop.
namespace scheme
#define NAMESPACE_SOURCE
#include "foo.h"
#ifndef NAMESPACE_FOO_H_
#define NAMESPACE_FOO_H_
#define ShortName Namespace_LongName
// forward declaration
typedef struct namespace_implementation_name_ ShortName;
struct namespace_implementation_name_
{
// ...
};
#ifndef NAMESPACE_SOURCE
#undef ShortName
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment