miloyip/rapidjson — pull request #193 by pah (2014-11-06 20:12:14+00:00)
Title: Allow customization of RapidJSON namespace

RapidJSON is a header-only library. As a result, bigger projects may include multiple, potentially slightly different versions of RapidJSON in the final binary. In order to avoid symbol clashes and/or "One Definition Rule" errors due to that, this pull-request allows the customization of the name of the main RapidJSON
namespace.

In case of a single nesting level, defining `RAPIDJSON_NAMESPACE` to a custom name (e.g. `MyRapidJSON`) is sufficient. If multiple levels are needed, both `RAPIDJSON_NAMESPACE_BEGIN` and `RAPIDJSON_NAMESPACE_END` need to be defined as well:

````cpp
// in some .cpp file
#define RAPIDJSON_NAMESPACE my::rapid::json
#define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapid { namespace json {
#define RAPIDJSON_NAMESPACE_END } } }
#include "rapidjson/..."
````
A `namespacetest.cpp` is added to the unit tests.