From 50b4de07844ca2a5781d7845115d7bd9e7c8f003 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 24 Feb 2012 09:58:48 +0200 Subject: C++11 support (initial infrastructure) --- libcommon/common/config-vc.h | 6 ++++++ libcommon/common/config.h.in | 1 + libcommon/common/makefile | 11 ++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'libcommon') diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 3c150cc..7031e35 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -10,4 +10,10 @@ #define HAVE_TR1_MEMORY +/* VC++10 has C++11 always enabled. + */ +#if _MSC_VER >= 1600 +# define HAVE_CXX11 +#endif + #endif /* LIBCOMMON_COMMON_CONFIG_VC_H */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 4bce49a..ed600ac 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -14,6 +14,7 @@ #undef DATABASE_ORACLE #undef DATABASE_MSSQL #undef HAVE_TR1_MEMORY +#undef HAVE_CXX11 #undef LIBCOMMON_STATIC_LIB #endif /* LIBCOMMON_COMMON_CONFIG_H */ diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 63aaea9..0742caf 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -40,7 +40,11 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h $(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommon $(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) -$(out_base)/config.h: $(dcf_root)/configuration-dynamic.make | $(out_base)/. +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard + +ifdef db_id +ifdef cxx_standard +$(out_base)/config.h: | $(out_base)/. @echo '/* file : libcommon/common/config.h' >$@ @echo ' * note : automatically generated' >>$@ @echo ' */' >>$@ @@ -59,9 +63,14 @@ else ifeq ($(db_id),oracle) else ifeq ($(db_id),mssql) @echo '#define DATABASE_MSSQL 1' >>$@ endif +ifeq ($(cxx_standard),c++11) + @echo '#define HAVE_CXX11 1' >>$@ +endif @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ +endif +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/config.h) -- cgit v1.1