From 01379ffa98201067728e63135eb1d6d66266650e Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Wed, 21 Sep 2011 21:42:44 +0200 Subject: [PATCH] Add a passthru test for C++0x. --- c++0x/Makefile | 9 ++++++--- c++0x/passthru.cpp | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 c++0x/passthru.cpp diff --git a/c++0x/Makefile b/c++0x/Makefile index fe1f331..9c74fc0 100644 --- a/c++0x/Makefile +++ b/c++0x/Makefile @@ -1,8 +1,11 @@ CXX=g++ CXXFLAGS=-std=gnu++0x -g -Wall $(shell xml2-config --cflags) LDFLAGS=$(shell xml2-config --libs) -OBJS=simple.o xml-template.o +LIBS=xml-template.o -simple: $(OBJS) - $(CXX) -o $@ $(OBJS) $(LDFLAGS) +passthru: passthru.o $(LIBS) + $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) + +simple: simple.o $(LIBS) + $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) diff --git a/c++0x/passthru.cpp b/c++0x/passthru.cpp new file mode 100644 index 0000000..2db2e3d --- /dev/null +++ b/c++0x/passthru.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +#include "xml-template.h" + +using namespace std; + +int main(int argc, char **argv) +{ + LIBXML_TEST_VERSION + + unordered_map master_map; + + xmlDocPtr doc = xmlParseFile("../xml/passthru.xml"); + Substitute(master_map).process(xmlDocGetRootElement(doc), false); + xmlSaveFile(argv[1], doc); + + xmlCleanupParser(); + xmlMemoryDump(); + return(0); +} -- 2.39.2