basho/erlang_protobuffs — pull request #12 by seancribbs (2012-05-23 21:04:50+00:00)
Title: Guard imported records against redefinition

**NOTE:** This is based off the branch that skips unknown fields, #11, and merging upstream changes, #10. Please review them first! _Apologies for the additional commit noise._

When you have a .proto file that imports another .proto file, it includes the definition of the imported messages in its own definition. This extends to the generated ".hrl" header file, meaning that if you try to include headers from the parent as well as the child definitions, or from two definitions that import the same parent, you get compiler errors about redefining the records of the parent's messages.

This pull-request guards the definition of each record with a pair of `-ifndef` `-define` preprocessor directives so that records are not defined twice.