From 32f05d55ae8f046fd10ef2822cb10630d0162b8c Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Sun, 24 Jan 2016 14:40:44 +0100 Subject: [PATCH 1/2] Use either -std=c++03 or -std=c++11 No intermediate pseudo-standards should be used when compiling. The option -std=c++11 is used by default now. Compile with `make defines=PUGIXML_NO_CXX11` to use -std=c++03 instead. --- .travis.yml | 6 +++--- Makefile | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7e4840..b5d9db0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ os: - linux - osx env: - - DEFINES=standard - - DEFINES=PUGIXML_WCHAR_MODE - - DEFINES=PUGIXML_COMPACT + - DEFINES=PUGIXML_NO_CXX11 + - DEFINES=PUGIXML_NO_CXX11,PUGIXML_WCHAR_MODE + - DEFINES=PUGIXML_NO_CXX11,PUGIXML_COMPACT script: - make test config=coverage defines=$DEFINES -j2 - make test config=release defines=$DEFINES -j2 diff --git a/Makefile b/Makefile index 777b82b..a7624f9 100644 --- a/Makefile +++ b/Makefile @@ -47,9 +47,10 @@ ifneq ($(findstring PUGIXML_NO_EXCEPTIONS,$(defines)),) CXXFLAGS+=-fno-exceptions endif -ifeq ($(findstring PUGIXML_NO_CXX11,$(defines)),) - # Can't use std=c++11 since Travis-CI has gcc 4.6.3 - CXXFLAGS+=-std=c++0x +ifneq ($(findstring PUGIXML_NO_CXX11,$(defines)),) + CXXFLAGS+=-std=c++03 +else + CXXFLAGS+=-std=c++11 endif OBJECTS=$(SOURCES:%=$(BUILD)/%.o) From ebdca940b4890ad4a80859fc6f10526a78061852 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Sun, 24 Jan 2016 15:17:07 +0100 Subject: [PATCH 2/2] test_parse.cpp: add newline to last line This is necessary in order to comply with the C++03 standard. --- tests/test_parse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_parse.cpp b/tests/test_parse.cpp index 47f774e..bf7a2d1 100644 --- a/tests/test_parse.cpp +++ b/tests/test_parse.cpp @@ -1181,4 +1181,4 @@ TEST(parse_embed_pcdata) CHECK_NODE_EX(doc, STR("\nvalue\n\nvalue1\nvalue2outer\ntext\n\n\n"), STR("\t"), 0); CHECK_NODE_EX(doc, STR("\n\tvalue\n\t\n\t\tvalue1\n\t\tvalue2outer\n\ttext\n\t\n\n"), STR("\t"), format_indent); } -} \ No newline at end of file +}