majintao0131 / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Rename .h to .hpp to not ever conflict with libyaml #128

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
libyaml already uses /usr/include/yaml.h.

This could potentially give unexpected trouble when including "yaml.h". To 
solve this ambiguity, I suggest changing every header's suffix in yaml-cpp to 
.hpp.

Original issue reported on code.google.com by svenst...@gmail.com on 12 Nov 2011 at 6:23

GoogleCodeExporter commented 9 years ago
The headers are already placed in PREFIX/yaml-cpp/, so there shouldn't be a 
conflict as long as you always use

#include "yaml-cpp/yaml.h"

Or is there a conflict I'm missing?

Original comment by jbe...@gmail.com on 12 Nov 2011 at 6:48

GoogleCodeExporter commented 9 years ago
In your tutorial you use #include "yaml.h" which is why I wondered. This should 
be made consistent. At any rate, I still think it should be renamed to resolve 
any and all ambiguities and .hpp seems more proper for C++.

Original comment by svenst...@gmail.com on 12 Nov 2011 at 7:05

GoogleCodeExporter commented 9 years ago
Good catch! I changed that to "yaml-cpp/yaml.h" in the documentation.

In general, I prefer .h, even for C++, and since it's in its own folder, there 
shouldn't be any ambiguity with libyaml's yaml.h.

Original comment by jbe...@gmail.com on 13 Nov 2011 at 6:20