From da393fc67ebce5fa269615c5c967f1467dc0d5cf Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 15 Apr 2018 12:09:27 +0100 Subject: C++17 and Ice 3.7 Update all code to be C++17 with Ice 3.7 and minor interface changes in keeping with C++CG and dependencies. --- .gitmodules | 4 ++ Jamroot.jam | 15 ++++--- ice | 1 + icespider/Jamfile.jam | 3 +- icespider/common/Jamfile.jam | 4 -- icespider/common/http.ice | 1 + icespider/common/pathparts.h | 2 + icespider/common/routes.ice | 73 ------------------------------- icespider/common/session.ice | 1 + icespider/compile/Jamfile.jam | 21 +++++---- icespider/compile/icespider.jam | 3 +- icespider/compile/main.cpp | 1 - icespider/compile/routeCompiler.cpp | 75 ++++++++------------------------ icespider/compile/routeCompiler.h | 6 +-- icespider/compile/routes.ice | 74 +++++++++++++++++++++++++++++++ icespider/compile/slice/Jamroot.jam | 22 ++++++++++ icespider/core/core.cpp | 14 +++--- icespider/core/core.h | 10 ++--- icespider/core/ihttpRequest.cpp | 32 +++++++------- icespider/core/ihttpRequest.h | 30 ++++++------- icespider/core/irouteHandler.cpp | 9 ---- icespider/core/irouteHandler.h | 7 ++- icespider/core/util.h | 4 +- icespider/fcgi/cgiRequestBase.cpp | 4 +- icespider/fileSessions/fileSessions.cpp | 21 ++++----- icespider/unittests/Jamfile.jam | 3 -- icespider/unittests/testApp.cpp | 13 +++--- icespider/unittests/testCompile.cpp | 77 ++++----------------------------- icespider/unittests/testFcgi.cpp | 20 ++++++++- icespider/xslt/Jamfile.jam | 2 - icespider/xslt/xsltStreamSerializer.cpp | 4 +- icespider/xslt/xsltStreamSerializer.h | 2 +- slice.jam | 12 ++--- 33 files changed, 247 insertions(+), 323 deletions(-) create mode 100644 .gitmodules create mode 160000 ice delete mode 100644 icespider/common/routes.ice create mode 100644 icespider/compile/routes.ice create mode 100644 icespider/compile/slice/Jamroot.jam diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e0e648c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "ice"] + path = ice + url = https://github.com/zeroc-ice/ice + branch = 3.7 diff --git a/Jamroot.jam b/Jamroot.jam index 563d34d..7f15912 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -7,13 +7,14 @@ variant coverage : debug ; project : requirements - "-std=c++17 -fvisibility=hidden" - "-Wl,-z,defs,--warn-once,--gc-sections" - release:"-fvisibility-inlines-hidden -flto=2" - release:"-flto=2" - debug:"-W -Wall -Wextra -Werror -Wwrite-strings" - coverage:"--coverage" - coverage:"--coverage" + ICE_CPP11_MAPPING + "-std=c++17 -fvisibility-inlines-hidden -Werror -fvisibility=hidden" + "-Wl,-z,defs,--warn-once,--gc-sections" + release:"-flto=2" + release:"-flto=2" + debug:"-W -Wall -Wextra -Werror -Wwrite-strings" + coverage:"--coverage" + coverage:"--coverage" ; build-project icespider ; diff --git a/ice b/ice new file mode 160000 index 0000000..fed3c47 --- /dev/null +++ b/ice @@ -0,0 +1 @@ +Subproject commit fed3c47a56b237ca307336f1ea8eeac94185ca1e diff --git a/icespider/Jamfile.jam b/icespider/Jamfile.jam index 02644a2..723d4f9 100644 --- a/icespider/Jamfile.jam +++ b/icespider/Jamfile.jam @@ -8,8 +8,7 @@ build-project xslt ; build-project fileSessions ; build-project testing ; -lib Ice ; -lib IceUtil ; +lib Ice : : Ice++11 ; lib pthread ; package.install install : : diff --git a/icespider/common/Jamfile.jam b/icespider/common/Jamfile.jam index a3acf6b..0c53482 100644 --- a/icespider/common/Jamfile.jam +++ b/icespider/common/Jamfile.jam @@ -5,7 +5,6 @@ cpp http-slicer : http.ice : pure - yes ; lib icespider-common : @@ -13,15 +12,12 @@ lib icespider-common : http-slicer : adhocutil - yes ..//pthread ..//Ice - ..//IceUtil slicer : : ..//pthread ..//Ice - ..//IceUtil . ; diff --git a/icespider/common/http.ice b/icespider/common/http.ice index 1f7dcd4..a44a492 100644 --- a/icespider/common/http.ice +++ b/icespider/common/http.ice @@ -1,6 +1,7 @@ #ifndef ICESPIDER_HTTP_ICE #define ICESPIDER_HTTP_ICE +[["ice-prefix"]] module IceSpider { ["slicer:ignore"] local exception HttpException { diff --git a/icespider/common/pathparts.h b/icespider/common/pathparts.h index 0720af0..e4d97a1 100644 --- a/icespider/common/pathparts.h +++ b/icespider/common/pathparts.h @@ -9,6 +9,8 @@ namespace IceSpider { class DLL_PUBLIC PathPart { public: + virtual ~PathPart() = default; + virtual bool matches(const std::string &) const = 0; }; typedef std::shared_ptr PathPartPtr; diff --git a/icespider/common/routes.ice b/icespider/common/routes.ice deleted file mode 100644 index 4a3d460..0000000 --- a/icespider/common/routes.ice +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef ICESPIDER_ROUTES_ICE -#define ICESPIDER_ROUTES_ICE - -#include "http.ice" - -module IceSpider { - local sequence StringSeq; - - local class Parameter { - ParameterSource source = URL; - optional(0) string key; - bool isOptional = false; - ["slicer:name:default"] - optional(1) string defaultExpr; - optional(2) string type; - - ["slicer:ignore"] - bool hasUserSource = true; - }; - - ["slicer:json:object"] - local dictionary Parameters; - - local class OutputSerializer { - string serializer; - StringSeq params; - }; - - ["slicer:json:object"] - local dictionary OutputSerializers; - - local class Operation { - string operation; - StringMap paramOverrides; - }; - - ["slicer:json:object"] - local dictionary Operations; - - local class Route { - string path; - HttpMethod method = GET; - optional(0) string operation; - Parameters params; - Operations operations; - string type; - OutputSerializers outputSerializers; - StringSeq bases; - StringSeq mutators; - }; - - ["slicer:json:object"] - local dictionary Routes; - - local class RouteBase { - StringSeq proxies; - StringSeq functions; - }; - - ["slicer:json:object"] - local dictionary RouteBases; - - local class RouteConfiguration { - string name; - Routes routes; - RouteBases routeBases; - StringSeq slices; - StringSeq headers; - }; -}; - -#endif - diff --git a/icespider/common/session.ice b/icespider/common/session.ice index 4947f9f..37c0c9b 100644 --- a/icespider/common/session.ice +++ b/icespider/common/session.ice @@ -1,6 +1,7 @@ #ifndef ICESPIDER_SESSION_ICE #define ICESPIDER_SESSION_ICE +[["ice-prefix"]] module IceSpider { dictionary Variables; diff --git a/icespider/compile/Jamfile.jam b/icespider/compile/Jamfile.jam index 986b3c3..2021abe 100644 --- a/icespider/compile/Jamfile.jam +++ b/icespider/compile/Jamfile.jam @@ -4,30 +4,32 @@ lib slicer-json ; lib boost_program_options ; lib boost_system ; lib boost_filesystem ; -lib Slice ; +lib mcpp ; lib icespider-compile : - [ glob-tree *.cpp : bin main.cpp ] - ../common/routes.ice + routeCompiler.cpp + routes.ice : - pure - yes + yes +# Need to disable LTO here cos of a GCC bug, this isn't +# performance critical anyway + -fno-lto + -fno-lto slicer adhocutil slicer-json boost_system boost_filesystem - Slice + slice//Slice ../common//icespider-common - ../common + ../common//icespider-common ..//Ice - ..//IceUtil ..//pthread + mcpp : : boost_system boost_filesystem ../common//icespider-common - ../common ; exe icespider : @@ -35,5 +37,6 @@ exe icespider : : boost_program_options icespider-compile + icespider-compile ; diff --git a/icespider/compile/icespider.jam b/icespider/compile/icespider.jam index 4513494..6f5266c 100644 --- a/icespider/compile/icespider.jam +++ b/icespider/compile/icespider.jam @@ -8,11 +8,10 @@ type.register JSON : json ; generators.register-standard icespider.routes2cpp : JSON : CPP(icespider-routes-%) H(icespider-routes-%) ; flags icespider.routes2cpp INCLUDES ; -flags icespider.routes2cpp ALLOWICE yes : --ice ; actions icespider.routes2cpp bind ICESPIDER { - icespider -I"$(INCLUDES)" $(ALLOWICE[1]) $(2) $(1[1]) + icespider -I"$(INCLUDES)" $(2) $(1[1]) } IMPORT $(__name__) : icespider.routes2cpp : : icespider.routes2cpp ; diff --git a/icespider/compile/main.cpp b/icespider/compile/main.cpp index 7be6579..3d5311f 100644 --- a/icespider/compile/main.cpp +++ b/icespider/compile/main.cpp @@ -14,7 +14,6 @@ main(int c, char ** v) ("input", po::value(&input), "Input .json file") ("output", po::value(&output), "Output .cpp file") ("include,I", po::value(&rc.searchPath)->composing(), "Search path") - ("ice", po::value(&rc.allowIcePrefix)->default_value(rc.allowIcePrefix)->zero_tokens(), "Allow reserved Ice prefix in Slice identifiers") ("help,h", po::value(&showHelp)->default_value(false)->zero_tokens(), "Help") ; po::positional_options_description pod; diff --git a/icespider/compile/routeCompiler.cpp b/icespider/compile/routeCompiler.cpp index e069b4f..40ce5fd 100644 --- a/icespider/compile/routeCompiler.cpp +++ b/icespider/compile/routeCompiler.cpp @@ -11,10 +11,10 @@ #include #include + namespace IceSpider { namespace Compile { - RouteCompiler::RouteCompiler() : - allowIcePrefix(false) + RouteCompiler::RouteCompiler() { searchPath.push_back(boost::filesystem::current_path()); } @@ -119,7 +119,7 @@ namespace IceSpider { { for (const auto & r : c->routes) { if (r.second->operation) { - r.second->operations[std::string()] = new Operation(*r.second->operation, {}); + r.second->operations[std::string()] = std::make_shared(*r.second->operation, StringMap()); } auto ps = findParameters(r.second, u); for (const auto & p : ps) { @@ -130,7 +130,7 @@ namespace IceSpider { } } else { - defined = r.second->params.insert({ p.first, new Parameter(ParameterSource::URL, p.first, false, IceUtil::Optional(), IceUtil::Optional(), false) }).first; + defined = r.second->params.insert({ p.first, std::make_shared(ParameterSource::URL, p.first, false, Ice::optional(), Ice::optional(), false) }).first; } auto d = defined->second; if (d->source == ParameterSource::URL) { @@ -206,7 +206,7 @@ namespace IceSpider { throw std::runtime_error("Preprocess failed"); } - Slice::UnitPtr u = Slice::Unit::createUnit(false, false, allowIcePrefix, false); + Slice::UnitPtr u = Slice::Unit::createUnit(false, false, false, false); uDestroy.onFailure.push_back([u]() { u->destroy(); }); int parseStatus = u->parse(realSlice.string(), cppHandle, false); @@ -247,16 +247,6 @@ namespace IceSpider { return boost::algorithm::replace_all_copy(os.second->serializer, ".", "::"); } - static - std::string - outputSerializerName(const IceSpider::OutputSerializers::value_type & os) - { - std::string name("_serializer_"); - std::replace_copy_if(os.first.begin(), os.first.end(), std::back_inserter(name), - std::not1(std::ptr_fun(isalnum)), '_'); - return name; - } - AdHocFormatter(MimePair, R"C({ "%?", "%?" })C"); static std::string @@ -268,48 +258,20 @@ namespace IceSpider { } void - RouteCompiler::defineOutputSerializers(FILE * output, RoutePtr r) const + RouteCompiler::registerOutputSerializers(FILE * output, RoutePtr r) const { for (const auto & os : r->outputSerializers) { - fprintf(output, ",\n"); - fprintbf(4, output, "%s(", - outputSerializerName(os)); + fprintbf(4, output, "addRouteSerializer(%s,\n", + outputSerializerMime(os)); + fprintbf(6, output, "std::make_shared<%s::IceSpiderFactory>(", + outputSerializerClass(os)); for (auto p = os.second->params.begin(); p != os.second->params.end(); ++p) { if (p != os.second->params.begin()) { fprintf(output, ", "); } fputs(p->c_str(), output); } - fprintf(output, ")"); - } - } - - void - RouteCompiler::registerOutputSerializers(FILE * output, RoutePtr r) const - { - for (const auto & os : r->outputSerializers) { - fprintbf(4, output, "addRouteSerializer(%s, &%s);\n", - outputSerializerMime(os), - outputSerializerName(os)); - } - } - - void - RouteCompiler::releaseOutputSerializers(FILE * output, RoutePtr r) const - { - for (const auto & os : r->outputSerializers) { - fprintbf(4, output, "removeRouteSerializer(%s);\n", - outputSerializerMime(os)); - } - } - - void - RouteCompiler::declareOutputSerializers(FILE * output, RoutePtr r) const - { - for (const auto & os : r->outputSerializers) { - fprintbf(3, output, "%s::IceSpiderFactory %s;\n", - outputSerializerClass(os), - outputSerializerName(os)); + fprintf(output, "));\n"); } } @@ -382,7 +344,7 @@ namespace IceSpider { fprintf(output, "\n"); unsigned int pn = 0; for (const auto & p : b.second->proxies) { - fprintbf(3, outputh, "const %sPrx prx%u;\n", + fprintbf(3, outputh, "const %sPrxPtr prx%u;\n", boost::algorithm::replace_all_copy(p, ".", "::"), pn); fprintbf(3, output, "prx%u(core->getProxy<%s>())", pn, boost::algorithm::replace_all_copy(p, ".", "::")); @@ -432,7 +394,6 @@ namespace IceSpider { fprintbf(4, output, "%s(core)", b); } auto proxies = initializeProxies(output, r.second); - defineOutputSerializers(output, r.second); for (const auto & p : r.second->params) { if (p.second->hasUserSource) { if (p.second->source == ParameterSource::URL) { @@ -458,7 +419,7 @@ namespace IceSpider { if (p.second->defaultExpr) { fprintf(output, ",\n"); fprintbf(4, output, "_pd_%s(%s)", - p.first, p.second->defaultExpr.get()); + p.first, *p.second->defaultExpr); } } fprintf(output, "\n"); @@ -467,7 +428,6 @@ namespace IceSpider { fprintbf(3, output, "}\n\n"); fprintbf(3, output, "~%s()\n", r.first); fprintbf(3, output, "{\n"); - releaseOutputSerializers(output, r.second); fprintbf(3, output, "}\n\n"); fprintbf(3, output, "void execute(IceSpider::IHttpRequest * request) const\n"); fprintbf(3, output, "{\n"); @@ -532,7 +492,6 @@ namespace IceSpider { fprintbf(3, output, "}\n\n"); fprintbf(2, output, "private:\n"); declareProxies(output, proxies); - declareOutputSerializers(output, r.second); for (const auto & p : r.second->params) { if (p.second->hasUserSource) { if (p.second->source == ParameterSource::URL) { @@ -573,7 +532,7 @@ namespace IceSpider { RouteCompiler::declareProxies(FILE * output, const Proxies & proxies) const { for (const auto & p : proxies) { - fprintbf(3, output, "const %sPrx prx%d;\n", boost::algorithm::replace_all_copy(p.first, ".", "::"), p.second); + fprintbf(3, output, "const %sPrxPtr prx%d;\n", boost::algorithm::replace_all_copy(p.first, ".", "::"), p.second); } } @@ -614,7 +573,7 @@ namespace IceSpider { for (const auto & o : r->operations) { auto proxyName = o.second->operation.substr(0, o.second->operation.find_last_of('.')); auto operation = o.second->operation.substr(o.second->operation.find_last_of('.') + 1); - fprintbf(4, output, "auto _ar_%s = prx%s->begin_%s(", o.first, proxies.find(proxyName)->second, operation); + fprintbf(4, output, "auto _ar_%s = prx%s->%sAsync(", o.first, proxies.find(proxyName)->second, operation); auto so = findOperation(o.second->operation, us); for (const auto & p : so->parameters()) { auto po = o.second->paramOverrides.find(p->name()); @@ -631,7 +590,7 @@ namespace IceSpider { auto t = findType(r->type, us); Slice::DataMemberList members; if (t.second) { - fprintbf(4, output, "%s _responseModel = new %s();\n", + fprintbf(4, output, "%s _responseModel = std::make_shared<%s>();\n", Slice::typeToString(t.second), t.second->scoped()); members = t.second->definition()->dataMembers(); @@ -650,7 +609,7 @@ namespace IceSpider { auto proxyName = o.second->operation.substr(0, o.second->operation.find_last_of('.')); auto operation = o.second->operation.substr(o.second->operation.find_last_of('.') + 1); if (mi->name() == o.first) { - fprintbf(output, "prx%s->end_%s(_ar_%s)", proxies.find(proxyName)->second, operation, o.first); + fprintbf(output, "_ar_%s.get()", o.first); isOp = true; break; } diff --git a/icespider/compile/routeCompiler.h b/icespider/compile/routeCompiler.h index cfc215f..b8bb6b9 100644 --- a/icespider/compile/routeCompiler.h +++ b/icespider/compile/routeCompiler.h @@ -23,20 +23,17 @@ namespace IceSpider { void compile(const boost::filesystem::path & input, const boost::filesystem::path & output) const; std::vector searchPath; - bool allowIcePrefix; private: typedef std::map Proxies; +#pragma GCC visibility push(hidden) void processConfiguration(FILE * output, FILE * outputh, const std::string & name, RouteConfigurationPtr, const Units &) const; void processBases(FILE * output, FILE * outputh, RouteConfigurationPtr, const Units &) const; void processBase(FILE * output, FILE * outputh, const RouteBases::value_type &, const Units &) const; void processRoutes(FILE * output, RouteConfigurationPtr, const Units &) const; void processRoute(FILE * output, const Routes::value_type &, const Units &) const; - void defineOutputSerializers(FILE * output, RoutePtr) const; void registerOutputSerializers(FILE * output, RoutePtr) const; - void releaseOutputSerializers(FILE * output, RoutePtr) const; - void declareOutputSerializers(FILE * output, RoutePtr) const; Proxies initializeProxies(FILE * output, RoutePtr) const; void declareProxies(FILE * output, const Proxies &) const; void addSingleOperation(FILE * output, RoutePtr, Slice::OperationPtr) const; @@ -48,6 +45,7 @@ namespace IceSpider { typedef std::pair Type; static Type findType(const std::string &, const Units &); static Type findType(const std::string &, const Slice::ContainerPtr &, const Ice::StringSeq & = Ice::StringSeq()); +#pragma GCC visibility pop }; } } diff --git a/icespider/compile/routes.ice b/icespider/compile/routes.ice new file mode 100644 index 0000000..2c25664 --- /dev/null +++ b/icespider/compile/routes.ice @@ -0,0 +1,74 @@ +#ifndef ICESPIDER_ROUTES_ICE +#define ICESPIDER_ROUTES_ICE + +#include "http.ice" + +[["ice-prefix"]] +module IceSpider { + local sequence StringSeq; + + local class Parameter { + ParameterSource source = URL; + optional(0) string key; + bool isOptional = false; + ["slicer:name:default"] + optional(1) string defaultExpr; + optional(2) string type; + + ["slicer:ignore"] + bool hasUserSource = true; + }; + + ["slicer:json:object"] + local dictionary Parameters; + + local class OutputSerializer { + string serializer; + StringSeq params; + }; + + ["slicer:json:object"] + local dictionary OutputSerializers; + + local class Operation { + string operation; + StringMap paramOverrides; + }; + + ["slicer:json:object"] + local dictionary Operations; + + local class Route { + string path; + HttpMethod method = GET; + optional(0) string operation; + Parameters params; + Operations operations; + string type; + OutputSerializers outputSerializers; + StringSeq bases; + StringSeq mutators; + }; + + ["slicer:json:object"] + local dictionary Routes; + + local class RouteBase { + StringSeq proxies; + StringSeq functions; + }; + + ["slicer:json:object"] + local dictionary RouteBases; + + local class RouteConfiguration { + string name; + Routes routes; + RouteBases routeBases; + StringSeq slices; + StringSeq headers; + }; +}; + +#endif + diff --git a/icespider/compile/slice/Jamroot.jam b/icespider/compile/slice/Jamroot.jam new file mode 100644 index 0000000..46b4e3c --- /dev/null +++ b/icespider/compile/slice/Jamroot.jam @@ -0,0 +1,22 @@ +project ice : + : requirements + ; + +path-constant ice : ../../../ice ; + +lib Slice : + $(ice)/cpp/src/Slice/Parser.cpp + $(ice)/cpp/src/Slice/Grammar.cpp + $(ice)/cpp/src/Slice/Preprocessor.cpp + $(ice)/cpp/src/Slice/CPlusPlusUtil.cpp + $(ice)/cpp/src/Slice/SliceUtil.cpp + $(ice)/cpp/src/Slice/FileTracker.cpp + $(ice)/cpp/src/Slice/Scanner.cpp + : + -fPIC + $(ice)/cpp/src + static + : : + $(ice)/cpp/src + ; + diff --git a/icespider/core/core.cpp b/icespider/core/core.cpp index 057faa6..bbb4b05 100644 --- a/icespider/core/core.cpp +++ b/icespider/core/core.cpp @@ -36,7 +36,7 @@ namespace IceSpider { pluginAdapter = communicator->createObjectAdapterWithEndpoints("plugins", "default"); for (const auto & pf : plugins) { auto p = pf->implementation()->create(communicator, communicator->getProperties()); - pluginAdapter->add(p, communicator->stringToIdentity(pf->name)); + pluginAdapter->add(p, Ice::stringToIdentity(pf->name)); } pluginAdapter->activate(); } @@ -48,15 +48,11 @@ namespace IceSpider { auto plugins = AdHoc::PluginManager::getDefault()->getAll(); if (!plugins.empty()) { for (const auto & pf : plugins) { - pluginAdapter->remove(communicator->stringToIdentity(pf->name)); + pluginAdapter->remove(Ice::stringToIdentity(pf->name)); } pluginAdapter->deactivate(); pluginAdapter->destroy(); } - // Terminate routes - for (auto r : allRoutes) { - delete r; - } if (communicator) communicator->destroy(); } @@ -119,7 +115,7 @@ namespace IceSpider { free(buf); } - Ice::ObjectPrx + Ice::ObjectPrxPtr Core::getProxy(const char * type) const { char * buf = __cxxabiv1::__cxa_demangle(type, NULL, NULL, NULL); @@ -174,9 +170,9 @@ namespace IceSpider { const auto & routeSet = routes[pathparts.size()]; bool match = false; for (const auto & r : routeSet) { - if (pathparts /= r) { + if (pathparts /= r.get()) { if (r->method == method) { - return r; + return r.get(); } match = true; } diff --git a/icespider/core/core.h b/icespider/core/core.h index f358009..f6fbd6e 100644 --- a/icespider/core/core.h +++ b/icespider/core/core.h @@ -11,7 +11,7 @@ namespace IceSpider { class DLL_PUBLIC Core { public: - typedef std::vector AllRoutes; + typedef std::vector AllRoutes; Core(const Ice::StringSeq & = {}); virtual ~Core(); @@ -20,12 +20,12 @@ namespace IceSpider { void process(IHttpRequest *, const IRouteHandler * = nullptr) const; void handleError(IHttpRequest *, const std::exception &) const; - Ice::ObjectPrx getProxy(const char * type) const; + Ice::ObjectPrxPtr getProxy(const char * type) const; template - typename Interface::ProxyType getProxy() const + auto getProxy() const { - return Interface::ProxyType::uncheckedCast(getProxy(typeid(Interface).name())); + return Ice::uncheckedCast(getProxy(typeid(Interface).name())); } AllRoutes allRoutes; @@ -40,7 +40,7 @@ namespace IceSpider { class DLL_PUBLIC CoreWithDefaultRouter : public Core { public: - typedef std::vector LengthRoutes; + typedef std::vector LengthRoutes; typedef std::vector Routes; CoreWithDefaultRouter(const Ice::StringSeq & = {}); diff --git a/icespider/core/ihttpRequest.cpp b/icespider/core/ihttpRequest.cpp index dea84e0..35eb465 100644 --- a/icespider/core/ihttpRequest.cpp +++ b/icespider/core/ihttpRequest.cpp @@ -46,15 +46,15 @@ namespace IceSpider { while ((v = sscanf(accept, " %[^ /] / %[^ ;,] %n , %n", grp, type, &chars, &chars)) == 2) { accept += chars; chars = 0; - auto a = new Accept(); + auto a = std::make_shared(); if ((v = sscanf(accept, " ; q = %f %n , %n", &pri, &chars, &chars)) == 1) { a->q = pri; } if (strcmp(grp, "*")) { - a->group = grp; + a->group.emplace(grp); } if (strcmp(type, "*")) { - a->type = type; + a->type.emplace(type); } accept += chars; accepts.push_back(a); @@ -98,8 +98,8 @@ namespace IceSpider { // Set-Cookie: value[; expires=date][; domain=domain][; path=path][; secure] // Sat, 02 May 2009 23:38:25 GMT void IHttpRequest::setCookie(const std::string & name, const std::string & value, - const IceUtil::Optional & d, const IceUtil::Optional & p, bool s, - IceUtil::Optional e) + const Ice::optional & d, const Ice::optional & p, bool s, + Ice::optional e) { std::stringstream o; o << XWwwFormUrlEncoded::urlencode(name) << @@ -119,13 +119,13 @@ namespace IceSpider { } template - inline IceUtil::Optional optionalLexicalCast(const IceUtil::Optional & p) + inline Ice::optional optionalLexicalCast(const Ice::optional & p) { if (p) return wrapLexicalCast(*p); - return IceUtil::Optional(); + return Ice::optional(); } - void IHttpRequest::responseRedirect(const std::string & url, const IceUtil::Optional & statusMsg) const + void IHttpRequest::responseRedirect(const std::string & url, const Ice::optional & statusMsg) const { setHeader("Location", url); response(303, (statusMsg ? *statusMsg : "Moved")); @@ -134,24 +134,24 @@ namespace IceSpider { #define getParams(T) \ template<> void IHttpRequest::setCookie(const std::string & n, const T & v, \ - const IceUtil::Optional & d, const IceUtil::Optional & p, \ - bool s, IceUtil::Optional e) { \ + const Ice::optional & d, const Ice::optional & p, \ + bool s, Ice::optional e) { \ setCookie(n, boost::lexical_cast(v), d, p, s, e); } \ template<> T IHttpRequest::getURLParam(unsigned int idx) const { \ return wrapLexicalCast(getURLParam(idx)); } \ - template<> IceUtil::Optional IHttpRequest::getQueryStringParam(const std::string & key) const { \ + template<> Ice::optional IHttpRequest::getQueryStringParam(const std::string & key) const { \ return optionalLexicalCast(getQueryStringParam(key)); } \ - template<> IceUtil::Optional IHttpRequest::getCookieParam(const std::string & key) const { \ + template<> Ice::optional IHttpRequest::getCookieParam(const std::string & key) const { \ return optionalLexicalCast(getCookieParam(key)); } \ - template<> IceUtil::Optional IHttpRequest::getHeaderParam(const std::string & key) const { \ + template<> Ice::optional IHttpRequest::getHeaderParam(const std::string & key) const { \ return optionalLexicalCast(getHeaderParam(key)); } template<> std::string IHttpRequest::getURLParam(unsigned int idx) const { return getURLParam(idx); } - template<> IceUtil::Optional IHttpRequest::getQueryStringParam(const std::string & key) const { \ + template<> Ice::optional IHttpRequest::getQueryStringParam(const std::string & key) const { \ return getQueryStringParam(key); } - template<> IceUtil::Optional IHttpRequest::getCookieParam(const std::string & key) const { \ + template<> Ice::optional IHttpRequest::getCookieParam(const std::string & key) const { \ return getCookieParam(key); } - template<> IceUtil::Optional IHttpRequest::getHeaderParam(const std::string & key) const { \ + template<> Ice::optional IHttpRequest::getHeaderParam(const std::string & key) const { \ return getHeaderParam(key); } getParams(bool); diff --git a/icespider/core/ihttpRequest.h b/icespider/core/ihttpRequest.h index b46477f..bbd83fb 100644 --- a/icespider/core/ihttpRequest.h +++ b/icespider/core/ihttpRequest.h @@ -5,9 +5,9 @@ #include #include #include -#include +#include #include -#include +#include #include namespace IceSpider { @@ -15,7 +15,7 @@ namespace IceSpider { class IRouteHandler; typedef std::vector PathElements; - typedef IceUtil::Optional OptionalString; + typedef Ice::optional OptionalString; typedef std::pair ContentTypeSerializer; class DLL_PUBLIC IHttpRequest { @@ -47,37 +47,37 @@ namespace IceSpider { template T getURLParam(unsigned int) const; template - IceUtil::Optional getBody() const + Ice::optional getBody() const { return Slicer::DeserializeAnyWith(getDeserializer()); } template - IceUtil::Optional getBodyParam(const IceUtil::Optional & map, const std::string & key) const + Ice::optional getBodyParam(const Ice::optional & map, const std::string & key) const { if (!map) { - return IceUtil::Optional(); + return Ice::optional(); } auto i = map->find(key); if (i == map->end()) { - return IceUtil::Optional(); + return Ice::optional(); } else { return boost::lexical_cast(i->second); } } - void responseRedirect(const std::string & url, const IceUtil::Optional & = IceUtil::None) const; + void responseRedirect(const std::string & url, const Ice::optional & = IceUtil::None) const; void setCookie(const std::string &, const std::string &, - const IceUtil::Optional & = IceUtil::None, const IceUtil::Optional & = IceUtil::None, - bool = false, IceUtil::Optional = IceUtil::None); + const Ice::optional & = IceUtil::None, const Ice::optional & = IceUtil::None, + bool = false, Ice::optional = IceUtil::None); template - void setCookie(const std::string &, const T &, const IceUtil::Optional & = IceUtil::None, - const IceUtil::Optional & = IceUtil::None, bool = false, IceUtil::Optional = IceUtil::None); + void setCookie(const std::string &, const T &, const Ice::optional & = IceUtil::None, + const Ice::optional & = IceUtil::None, bool = false, Ice::optional = IceUtil::None); template - IceUtil::Optional getQueryStringParam(const std::string & key) const; + Ice::optional getQueryStringParam(const std::string & key) const; template - IceUtil::Optional getHeaderParam(const std::string & key) const; + Ice::optional getHeaderParam(const std::string & key) const; template - IceUtil::Optional getCookieParam(const std::string & key) const; + Ice::optional getCookieParam(const std::string & key) const; virtual void response(short, const std::string &) const = 0; template void response(const IRouteHandler * route, const T & t) const diff --git a/icespider/core/irouteHandler.cpp b/icespider/core/irouteHandler.cpp index 55e9f99..348ac8e 100644 --- a/icespider/core/irouteHandler.cpp +++ b/icespider/core/irouteHandler.cpp @@ -52,14 +52,5 @@ namespace IceSpider { routeSerializers.erase(ct); routeSerializers.insert({ ct, ssfp }); } - - void - IRouteHandler::removeRouteSerializer(const MimeType & ct) - { - auto i = routeSerializers.find(ct); - if (i != routeSerializers.end()) { - routeSerializers.erase(i); - } - } } diff --git a/icespider/core/irouteHandler.h b/icespider/core/irouteHandler.h index f3e271b..38bc1ed 100644 --- a/icespider/core/irouteHandler.h +++ b/icespider/core/irouteHandler.h @@ -5,10 +5,8 @@ #include "util.h" #include "exceptions.h" #include -#include #include #include -#include namespace IceSpider { class Core; @@ -25,7 +23,7 @@ namespace IceSpider { const HttpMethod method; protected: - typedef Slicer::StreamSerializerFactory * StreamSerializerFactoryPtr; + typedef std::shared_ptr StreamSerializerFactoryPtr; typedef std::map RouteSerializers; RouteSerializers routeSerializers; @@ -41,8 +39,9 @@ namespace IceSpider { } void addRouteSerializer(const MimeType &, StreamSerializerFactoryPtr); - void removeRouteSerializer(const MimeType &); }; + typedef std::shared_ptr IRouteHandlerPtr; + typedef std::shared_ptr IRouteHandlerCPtr; typedef AdHoc::Factory RouteHandlerFactory; } diff --git a/icespider/core/util.h b/icespider/core/util.h index 461211d..658a1cc 100644 --- a/icespider/core/util.h +++ b/icespider/core/util.h @@ -4,9 +4,9 @@ #include #include -namespace IceUtil { +namespace std::experimental::Ice { template - auto operator/(const IceUtil::Optional & o, const TF & tf) -> decltype(tf()) + auto operator/(const Ice::optional & o, const TF & tf) -> decltype(tf()) { if (o) return *o; return tf(); diff --git a/icespider/fcgi/cgiRequestBase.cpp b/icespider/fcgi/cgiRequestBase.cpp index 48a9daa..afeb560 100644 --- a/icespider/fcgi/cgiRequestBase.cpp +++ b/icespider/fcgi/cgiRequestBase.cpp @@ -186,7 +186,7 @@ namespace IceSpider { CgiRequestBase::setQueryStringParam(const std::string & key, const OptionalString & val) { if (val) - qsmap[key] = val; + qsmap[key] = *val; else qsmap.erase(key); } @@ -201,7 +201,7 @@ namespace IceSpider { CgiRequestBase::setCookieParam(const std::string & key, const OptionalString & val) { if (val) - cookiemap[key] = val; + cookiemap[key] = *val; else cookiemap.erase(key); } diff --git a/icespider/fileSessions/fileSessions.cpp b/icespider/fileSessions/fileSessions.cpp index 1672842..7791d3c 100644 --- a/icespider/fileSessions/fileSessions.cpp +++ b/icespider/fileSessions/fileSessions.cpp @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include "Ice/Initialize.h" namespace IceSpider { @@ -33,14 +34,14 @@ namespace IceSpider { SessionPtr createSession(const ::Ice::Current &) override { - SessionPtr s = new Session(); + auto s = std::make_shared(); s->id = boost::lexical_cast(boost::uuids::random_generator()()); s->duration = duration; save(s); return s; } - SessionPtr getSession(const ::std::string & id, const ::Ice::Current & current) override + SessionPtr getSession(const ::std::string id, const ::Ice::Current & current) override { auto s = load(id); if (s && isExpired(s)) { @@ -50,12 +51,12 @@ namespace IceSpider { return s; } - void updateSession(const SessionPtr & s, const ::Ice::Current &) override + void updateSession(const SessionPtr s, const ::Ice::Current &) override { save(s); } - void destroySession(const ::std::string & id, const ::Ice::Current &) override + void destroySession(const ::std::string id, const ::Ice::Current &) override { try { boost::filesystem::remove(root / id); @@ -69,9 +70,9 @@ namespace IceSpider { void save(SessionPtr s) { s->lastUsed = time(NULL); - auto buf = Ice::createOutputStream(ic); - buf->write(s); - auto range = buf->finished(); + Ice::OutputStream buf(ic); + buf.write(s); + auto range = buf.finished(); AdHoc::FileUtils::FileHandle f(root / s->id, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); sysassert(flock(f.fh, LOCK_EX), -1); sysassert(pwrite(f.fh, range.first, range.second - range.first, 0), -1); @@ -87,9 +88,9 @@ namespace IceSpider { AdHoc::FileUtils::MemMap f(path); sysassert(flock(f.fh, LOCK_SH), -1); auto fbuf = (Ice::Byte *)f.data; - auto buf = Ice::createInputStream(ic, std::make_pair(fbuf, fbuf + f.getStat().st_size)); + Ice::InputStream buf(ic, std::make_pair(fbuf, fbuf + f.getStat().st_size)); SessionPtr s; - buf->read(s); + buf.read(s); sysassert(flock(f.fh, LOCK_UN), -1); return s; } diff --git a/icespider/unittests/Jamfile.jam b/icespider/unittests/Jamfile.jam index 4dcc450..af8041c 100644 --- a/icespider/unittests/Jamfile.jam +++ b/icespider/unittests/Jamfile.jam @@ -30,9 +30,7 @@ path-constant me : . ; alias testCommon : : ROOT=\"$(me)\" ..//Ice - ..//IceUtil : : - ..//IceUtil ..//Ice boost_utf ROOT=\"$(me)\" @@ -127,6 +125,5 @@ lib test-api : adhocutil ..//pthread ..//Ice - ..//IceUtil ; diff --git a/icespider/unittests/testApp.cpp b/icespider/unittests/testApp.cpp index 9714d33..918a056 100644 --- a/icespider/unittests/testApp.cpp +++ b/icespider/unittests/testApp.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -139,17 +140,17 @@ class TestSerice : public TestIceSpider::TestApi { public: TestIceSpider::SomeModelPtr index(const Ice::Current &) override { - return new TestIceSpider::SomeModel("index"); + return std::make_shared("index"); } - TestIceSpider::SomeModelPtr withParams(const std::string & s, Ice::Int i, const Ice::Current &) override + TestIceSpider::SomeModelPtr withParams(const std::string s, Ice::Int i, const Ice::Current &) override { BOOST_REQUIRE_EQUAL(s, "something"); BOOST_REQUIRE_EQUAL(i, 1234); - return new TestIceSpider::SomeModel("withParams"); + return std::make_shared("withParams"); } - void returnNothing(const std::string & s, const Ice::Current &) override + void returnNothing(const std::string s, const Ice::Current &) override { if (s == "error") { throw TestIceSpider::Ex("test error"); @@ -160,7 +161,7 @@ class TestSerice : public TestIceSpider::TestApi { BOOST_REQUIRE_EQUAL(s, "some value"); } - void complexParam(const IceUtil::Optional & s, const TestIceSpider::SomeModelPtr & m, const Ice::Current &) override + void complexParam(const Ice::optional s, const TestIceSpider::SomeModelPtr m, const Ice::Current &) override { BOOST_REQUIRE(s); BOOST_REQUIRE_EQUAL("1234", *s); @@ -185,7 +186,7 @@ class TestApp : public CoreWithDefaultRouter { adp(communicator->createObjectAdapterWithEndpoints("test", "default")) { adp->activate(); - adp->add(new TestSerice(), communicator->stringToIdentity("Test")); + adp->add(std::make_shared(), Ice::stringToIdentity("Test")); } ~TestApp() diff --git a/icespider/unittests/testCompile.cpp b/icespider/unittests/testCompile.cpp index 6fde743..7b451bf 100644 --- a/icespider/unittests/testCompile.cpp +++ b/icespider/unittests/testCompile.cpp @@ -7,6 +7,7 @@ #include "../compile/routeCompiler.h" #include "../core/irouteHandler.h" #include +#include using namespace IceSpider; @@ -25,6 +26,13 @@ class CoreFixture { boost::filesystem::path modeDir; }; +namespace std { + ostream & operator<<(ostream & s, const IceSpider::HttpMethod & m) { + s << Slicer::ModelPartForEnum::lookup(m); + return s; + } +} + BOOST_FIXTURE_TEST_SUITE(cf, CoreFixture) BOOST_AUTO_TEST_CASE( testLoadConfiguration ) @@ -40,7 +48,7 @@ BOOST_AUTO_TEST_CASE( testLoadConfiguration ) BOOST_REQUIRE_EQUAL("/", cfg->routes["index"]->path); BOOST_REQUIRE_EQUAL(HttpMethod::GET, cfg->routes["index"]->method); - BOOST_REQUIRE_EQUAL("TestIceSpider.TestApi.index", cfg->routes["index"]->operation); + BOOST_REQUIRE_EQUAL("TestIceSpider.TestApi.index", *cfg->routes["index"]->operation); BOOST_REQUIRE_EQUAL(0, cfg->routes["index"]->params.size()); BOOST_REQUIRE_EQUAL("/view/{s}/{i}", cfg->routes["item"]->path); @@ -72,72 +80,5 @@ BOOST_AUTO_TEST_CASE( testRouteCompile ) rc.compile(input, outputc); } -BOOST_AUTO_TEST_CASE( testCompile ) -{ - auto outputc = binDir / "testRoutes.cpp"; - auto outputo = binDir / "testRoutes.o"; - auto libGenDir = (rootDir / "bin" / modeDir / "slicer-yes"); - - auto compileCommand = boost::algorithm::join>({ - "gcc", "-c", "-std=c++1y", "-fPIC", "-fvisibility=hidden", "-O3", "-flto", "-fvisibility-inlines-hidden", - "-I", "/usr/include/adhocutil", - "-I", "/usr/include/glib-2.0", - "-I", "/usr/include/glibmm-2.4", - "-I", "/usr/include/libxml2", - "-I", "/usr/include/libxml++-3.0", - "-I", "/usr/include/libxslt", - "-I", "/usr/include/slicer", - "-I", "/usr/lib/glib-2.0/include", - "-I", "/usr/lib/glibmm-2.4/include", - "-I", "/usr/lib/libxml++-3.0/include", - "-I", rootDir.string(), - "-I", (rootDir.parent_path() / "core").string(), - "-I", (rootDir.parent_path() / "common").string(), - "-I", (rootDir.parent_path() / "xslt").string(), - "-I", (rootDir.parent_path() / "common" / "bin" / modeDir / "allow-ice-yes").string(), - "-I", libGenDir.string(), - "-o", outputo.string(), - outputc.string(), - }, " "); - BOOST_TEST_INFO("Compile command: " << compileCommand); - int compileResult = system(compileCommand.c_str()); - BOOST_REQUIRE_EQUAL(0, compileResult); -} - -BOOST_AUTO_TEST_CASE( testLink ) -{ - auto outputo = binDir / "testRoutes.o"; - BOOST_REQUIRE(boost::filesystem::exists(outputo)); - auto outputso = binDir / "testRoutes.so"; - - auto linkCommand = boost::algorithm::join>({ - "gcc", "-shared", "-Wl,--warn-once,--gc-sections,-z,lazy", - "-o", outputso.string(), - outputo.string(), - }, " "); - BOOST_TEST_INFO("Link command: " << linkCommand); - int linkResult = system(linkCommand.c_str()); - BOOST_REQUIRE_EQUAL(0, linkResult); -} - -BOOST_AUTO_TEST_CASE( testLoad ) -{ - auto outputso = binDir / "testRoutes.so"; - BOOST_REQUIRE(boost::filesystem::exists(outputso)); - - auto lib = dlopen(outputso.c_str(), RTLD_LAZY); - BOOST_TEST_INFO(dlerror()); - BOOST_REQUIRE(lib); - - BOOST_REQUIRE_EQUAL(13, AdHoc::PluginManager::getDefault()->getAll().size()); - // smoke test (block ensure dlclose dones't cause segfault) - { - auto route = AdHoc::PluginManager::getDefault()->get("common::index"); - BOOST_REQUIRE(route); - } - - BOOST_REQUIRE_EQUAL(0, dlclose(lib)); -} - BOOST_AUTO_TEST_SUITE_END(); diff --git a/icespider/unittests/testFcgi.cpp b/icespider/unittests/testFcgi.cpp index ae4f1cf..6d3d7d5 100644 --- a/icespider/unittests/testFcgi.cpp +++ b/icespider/unittests/testFcgi.cpp @@ -5,6 +5,24 @@ #include #include #include +#include + +using namespace std::literals; +namespace std { + template + ostream & operator<<(ostream & s, const Ice::optional & o) { + if (o) s << *o; + return s; + } +} + +namespace std { + ostream & operator<<(ostream & s, const IceSpider::HttpMethod & m) { + s << Slicer::ModelPartForEnum::lookup(m); + return s; + } +} + class TestRequest : public IceSpider::CgiRequestBase { public: @@ -272,7 +290,7 @@ BOOST_AUTO_TEST_CASE( cookies ) BOOST_REQUIRE_EQUAL(1234, *r.IceSpider::IHttpRequest::getCookieParam("valueA")); BOOST_REQUIRE_EQUAL("Something with spaces.", *r.IceSpider::IHttpRequest::getCookieParam("value B")); BOOST_REQUIRE(!r.IceSpider::IHttpRequest::getCookieParam("notAThing")); - r.setCookie("some int.", 1234, "www.com", "/dir", true, 1476142378); + r.setCookie("some int.", 1234, "www.com"s, "/dir"s, true, 1476142378); BOOST_REQUIRE_EQUAL("Set-Cookie: some+int%2e=1234; expires=Mon, 10 Oct 2016 23:32:58 GMT; domain=www.com; path=/dir; secure\r\n", r.out.str()); } diff --git a/icespider/xslt/Jamfile.jam b/icespider/xslt/Jamfile.jam index 97408be..eacdda4 100644 --- a/icespider/xslt/Jamfile.jam +++ b/icespider/xslt/Jamfile.jam @@ -2,7 +2,6 @@ lib adhocutil : : : : /usr/include/adhocutil ; lib slicer-xml : : : : /usr/include/slicer ; lib boost_system ; lib boost_filesystem ; -lib IceUtil ; lib xslt ; lib exslt ; @@ -13,7 +12,6 @@ lib icespider-xslt : slicer-xml boost_system boost_filesystem - IceUtil xslt exslt ../..//libxmlpp diff --git a/icespider/xslt/xsltStreamSerializer.cpp b/icespider/xslt/xsltStreamSerializer.cpp index d89adcd..5214ab3 100644 --- a/icespider/xslt/xsltStreamSerializer.cpp +++ b/icespider/xslt/xsltStreamSerializer.cpp @@ -29,7 +29,7 @@ namespace IceSpider { xsltFreeStylesheet(stylesheet); } - XsltStreamSerializer * + Slicer::SerializerPtr XsltStreamSerializer::IceSpiderFactory::create(std::ostream & strm) const { auto newMtime = boost::filesystem::last_write_time(stylesheetPath); @@ -43,7 +43,7 @@ namespace IceSpider { } stylesheetWriteTime = newMtime; } - return new XsltStreamSerializer(strm, stylesheet); + return std::make_shared(strm, stylesheet); } XsltStreamSerializer::XsltStreamSerializer(std::ostream & os, xsltStylesheet * ss) : diff --git a/icespider/xslt/xsltStreamSerializer.h b/icespider/xslt/xsltStreamSerializer.h index b061012..eb432fb 100644 --- a/icespider/xslt/xsltStreamSerializer.h +++ b/icespider/xslt/xsltStreamSerializer.h @@ -14,7 +14,7 @@ namespace IceSpider { IceSpiderFactory(const char *); ~IceSpiderFactory(); - XsltStreamSerializer * create(std::ostream &) const override; + Slicer::SerializerPtr create(std::ostream &) const override; private: const boost::filesystem::path stylesheetPath; diff --git a/slice.jam b/slice.jam index 434e562..d261c50 100644 --- a/slice.jam +++ b/slice.jam @@ -8,7 +8,6 @@ import toolset ; type.register SLICE : ice ; feature slicer : no yes pure ; -feature allow-ice : no yes ; feature ice-visibility : public hidden ; class slice-scanner : common-scanner @@ -29,27 +28,24 @@ generators.register-standard slice.slicer.pure : SLICE : CPP(slicer-%) : ; toolset.flags slice.slice2cpp DLLEXPORT public : --dll-export JAM_DLL_PUBLIC ; -toolset.flags slice.slice2cpp ALLOWICE yes : --ice ; toolset.flags slice.slicer INCLUDES ; toolset.flags slice.slicer DLLEXPORT public : --dll-export JAM_DLL_PUBLIC ; -toolset.flags slice.slicer ALLOWICE yes : --ice ; toolset.flags slice.slicer.pure INCLUDES ; -toolset.flags slice.slicer.pure ALLOWICE yes : --ice ; actions slice.slice2cpp { - slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT) $(ALLOWICE[1]) + slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT) } actions slice.slicer { - slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT) $(ALLOWICE[1]) - slicer -I"$(INCLUDES)" $(2) $(1[2]) $(ALLOWICE[1]) + slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT) + slicer -I"$(INCLUDES)" $(2) $(1[2]) } actions slice.slicer.pure { - slicer -I"$(INCLUDES)" $(2) $(1[1]) $(ALLOWICE[1]) + slicer -I"$(INCLUDES)" $(2) $(1[1]) } IMPORT $(__name__) : slice.slice2cpp : : slice.slice2cpp ; -- cgit v1.2.3