build: add -std=c++03 (in non C++11 mode) and -pedantic to the default CXXFLAGS
And fix the resulting warnings. The long-long-int warning is explicitly
suppressed because it's not trivial to workaround in a platform-independent
and ISO-conformant way without using C++11.
This commit also includes fix for the advisory check for C++11-enabled
compiler in common.hpp (gcc < 4.7 does not correctly define __cpluplus
macro).
Finally, when custom CXXFLAGS are specified, --with-c++11 does not force
-std=c++11 or -std=c++0x flags, but just performs mandatory checks for
std::shared_ptr and std::function.
Change-Id: Icf44627edfddd34301bd27a05882b62fcbf54329
diff --git a/wscript b/wscript
index 4198fa3..b920afc 100644
--- a/wscript
+++ b/wscript
@@ -94,14 +94,12 @@
conf.check_cryptopp(path=conf.options.cryptopp_dir, mandatory=True)
if conf.options.use_cxx11:
- conf.add_supported_cxxflags(cxxflags=['-std=c++11', '-std=c++0x'])
-
conf.check(msg='Checking for type std::shared_ptr',
type_name="std::shared_ptr<int>", header_name="memory",
- define_name='HAVE_STD_SHARED_PTR')
+ define_name='HAVE_STD_SHARED_PTR', mandatory=True)
conf.check(msg='Checking for type std::function',
type_name="std::function<void()>", header_name="functional",
- define_name='HAVE_STD_FUNCTION')
+ define_name='HAVE_STD_FUNCTION', mandatory=True)
conf.define('HAVE_CXX11', 1)
USED_BOOST_LIBS = ['system', 'filesystem', 'date_time', 'iostreams',