summaryrefslogtreecommitdiff
path: root/libs/wave/src/wave_config_constant.cpp
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 12:57:26 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 12:57:26 -0700
commit1a78a62555be32868418fe52f8e330c9d0f95d5a (patch)
treed3765a80e7d3b9640ec2e930743630cd6b9fce2b /libs/wave/src/wave_config_constant.cpp
downloadboost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.gz
boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.bz2
boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.zip
Imported Upstream version 1.49.0upstream/1.49.0
Diffstat (limited to 'libs/wave/src/wave_config_constant.cpp')
-rw-r--r--libs/wave/src/wave_config_constant.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/wave/src/wave_config_constant.cpp b/libs/wave/src/wave_config_constant.cpp
new file mode 100644
index 0000000000..86a9f829e1
--- /dev/null
+++ b/libs/wave/src/wave_config_constant.cpp
@@ -0,0 +1,48 @@
+/*=============================================================================
+ Boost.Wave: A Standard compliant C++ preprocessor library
+ Persistent application configuration
+
+ http://www.boost.org/
+
+ Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Software License, Version 1.0. (See accompanying file
+ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+#define BOOST_WAVE_SOURCE 1
+
+// disable stupid compiler warnings
+#include <boost/config/warning_disable.hpp>
+
+#include <cstring>
+#include <boost/preprocessor/stringize.hpp>
+
+#include <boost/wave/wave_config.hpp>
+#include <boost/wave/wave_config_constant.hpp>
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace wave {
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Call this function to test the configuration of the calling application
+ // against the configuration of the linked library.
+ BOOST_WAVE_DECL bool
+ test_configuration(unsigned int config, char const* pragma_keyword,
+ char const* string_type_str)
+ {
+ if (NULL == pragma_keyword || NULL == string_type_str)
+ return false;
+
+ using namespace std;; // some systems have strcmp in namespace std
+ if (config != BOOST_WAVE_CONFIG ||
+ strcmp(pragma_keyword, BOOST_WAVE_PRAGMA_KEYWORD) ||
+ strcmp(string_type_str, BOOST_PP_STRINGIZE((BOOST_WAVE_STRINGTYPE))))
+ {
+ return false;
+ }
+ return true;
+ }
+
+///////////////////////////////////////////////////////////////////////////////
+}} // namespace boost::wave
+