aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-03-02 12:29:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-03-02 12:29:37 +0200
commit34a371625b17428aa0e35488499a2a7b69b0da27 (patch)
tree36bea5761f603245de6e5220f318e532d379dbf5 /common
parente67a19c220db8315914a74be7b3527535e480c87 (diff)
C++11 support in automake and VC++ projects, portability fixes
Diffstat (limited to 'common')
-rw-r--r--common/lazy-ptr/driver.cxx9
-rw-r--r--common/template/Makefile.am4
-rw-r--r--common/template/template-vc10.vcxproj2
-rw-r--r--common/template/template-vc9.vcproj2
4 files changed, 11 insertions, 6 deletions
diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx
index 2e2f140..3be6517 100644
--- a/common/lazy-ptr/driver.cxx
+++ b/common/lazy-ptr/driver.cxx
@@ -12,6 +12,7 @@
#include <odb/database.hxx>
#include <odb/transaction.hxx>
+#include <odb/details/config.hxx> // ODB_CXX11_*
#include <common/common.hxx>
@@ -116,7 +117,7 @@ main (int argc, char* argv[])
// Correct object ids.
//
-#ifdef HAVE_CXX11
+#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT)
assert (c->o[0].object_id () == o->id);
assert (o->c.object_id () == c->id);
#else
@@ -196,7 +197,7 @@ main (int argc, char* argv[])
// Correct object ids.
//
-#ifdef HAVE_CXX11
+#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT)
assert (c->o.object_id () == o->id);
assert (o->c.object_id () == c->id);
#else
@@ -320,7 +321,7 @@ main (int argc, char* argv[])
// Correct object ids.
//
-#ifdef HAVE_CXX11
+#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT)
assert (c->o[0].object_id () == o->id);
assert (o->c.object_id () == c->id);
#else
@@ -352,7 +353,7 @@ main (int argc, char* argv[])
lazy_shared_ptr<obj> l (c->o[1].lock ());
assert (!l.loaded ());
-#ifdef HAVE_CXX11
+#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT)
assert (l.object_id () == c->o[1].object_id ());
#else
assert (l.object_id<obj> () == c->o[1].object_id<obj> ());
diff --git a/common/template/Makefile.am b/common/template/Makefile.am
index 47715ce..4478502 100644
--- a/common/template/Makefile.am
+++ b/common/template/Makefile.am
@@ -26,6 +26,10 @@ ODB = @ODB@
ODBFLAGS = @ODBFLAGS@
ODBCPPFLAGS = @ODBCPPFLAGS@
+if HAVE_CXX11
+ODBFLAGS += --std c++11
+endif
+
test-odb.hxx: test.hxx
$(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $<
)
diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj
index bdaf37b..5666584 100644
--- a/common/template/template-vc10.vcxproj
+++ b/common/template/template-vc10.vcxproj
@@ -160,7 +160,7 @@ m4_dnl
__custom_build_entry__(
test.hxx,
odb test.hxx,
-odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\libcommon)) test.hxx,
+odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx,
test-odb.hxx;test-odb.ixx;test-odb.cxx)
</ItemGroup>)
<ItemGroup>
diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj
index 9bb8cf8..caf7201 100644
--- a/common/template/template-vc9.vcproj
+++ b/common/template/template-vc9.vcproj
@@ -349,7 +349,7 @@ m4_ifelse(__value__(odb_options),,,
__file_entry_custom_build__(
test.hxx,
odb test.hxx,
-odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\libcommon)) test.hxx,
+odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx,
test-odb.hxx;test-odb.ixx;test-odb.cxx)
__file_entry__(test-odb.hxx)
__file_entry__(test-odb.ixx))