Add include guards for XMLConfiguration and JSONConfiguration in Poco::Util. This will prevent accidental linking of the XML and JSON libraries when enabled.

This commit is contained in:
Mike Naquin 2012-11-14 10:34:27 -06:00
parent 5f1d1b02e2
commit 6d586537bb
4 changed files with 28 additions and 0 deletions

View File

@ -36,6 +36,11 @@
//
// Avoid accidental linking of JSON library when JSONConfiguration
// is not desired.
#ifndef POCO_UTIL_NO_JSONCONFIGURATION
#ifndef Util_JSONConfiguration_INCLUDED
#define Util_JSONConfiguration_INCLUDED
@ -160,3 +165,5 @@ private:
#endif // Util_JSONConfiguration_INCLUDED
#endif // POCO_UTIL_NO_JSONCONFIGURATION

View File

@ -36,6 +36,11 @@
//
// Avoid accidental linking of XML library when XMLConfiguration
// is not desired.
#ifndef POCO_UTIL_NO_XMLCONFIGURATION
#ifndef Util_XMLConfiguration_INCLUDED
#define Util_XMLConfiguration_INCLUDED
@ -215,3 +220,5 @@ private:
#endif // Util_XMLConfiguration_INCLUDED
#endif // POCO_UTIL_NO_XMLCONFIGURATION

View File

@ -34,6 +34,11 @@
//
// Avoid accidental linking of JSON library when JSONConfiguration
// is not desired.
#ifndef POCO_UTIL_NO_JSONCONFIGURATION
#include "Poco/FileStream.h"
#include "Poco/StringTokenizer.h"
#include "Poco/Util/JSONConfiguration.h"
@ -404,3 +409,5 @@ void JSONConfiguration::removeRaw(const std::string& key)
} } // namespace Poco::Util
#endif // POCO_UTIL_NO_JSONCONFIGURATION

View File

@ -34,6 +34,11 @@
//
// Avoid accidental linking of XML library when XMLConfiguration
// is not desired.
#ifndef POCO_UTIL_NO_XMLCONFIGURATION
#include "Poco/Util/XMLConfiguration.h"
#include "Poco/SAX/InputSource.h"
#include "Poco/DOM/DOMParser.h"
@ -484,3 +489,5 @@ Poco::XML::Node* XMLConfiguration::findAttribute(const std::string& name, Poco::
} } // namespace Poco::Util
#endif // POCO_UTIL_NO_XMLCONFIGURATION