Closed GoogleCodeExporter closed 9 years ago
My standard practice, especially with external library headers, is to use a
generated
UUID value (with underscores substituted for dashes) as part of the header guard
#define name. If all external header names are unique, one UUID can be used in
combination with the header file name for the whole project.
An example would be:
{{{
#pragma once
#ifndef YAML_H_32DC4090_EB12_4bb6_8366_5A5F9A71B700
#define YAML_H_32DC4090_EB12_4bb6_8366_5A5F9A71B700
// Header contents go here
#endif // YAML_H_32DC4090_EB12_4bb6_8366_5A5F9A71B700
}}}
This way, no reasonable project will have header guard conflicts with the
yaml-cpp
library.
Original comment by rtweeks21
on 29 Jul 2009 at 6:27
Good idea. I've only ever used MSVC and gcc, so I've never quite known how
portable
it is. And thanks, rtweeks, for the UUID suggestion.
Original comment by jbe...@gmail.com
on 29 Jul 2009 at 10:32
Original issue reported on code.google.com by
swiftcoder
on 29 Jul 2009 at 6:15