]> git.tdb.fi Git - builder.git/commitdiff
Use bound loader function arguments for binary component types
authorMikko Rasa <tdb@tdb.fi>
Mon, 19 Dec 2022 14:19:21 +0000 (16:19 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 19 Dec 2022 17:19:09 +0000 (19:19 +0200)
source/sourcepackage.cpp
source/sourcepackage.h

index 74c38864bce10cb4f63bdd5888604b0f69841365..601627185a26e9e21f558567807d547fcc623733 100644 (file)
@@ -180,9 +180,9 @@ SourcePackage::Loader::Loader(SourcePackage &p, const Config::InputOptions *o):
        add("generate",    &Loader::generate);
        add("install",     &Loader::component<InstallComponent>);
        add("interface_version", &Loader::interface_version);
-       add("library",     &Loader::component_arg<BinaryComponent, BinaryComponent::Type, BinaryComponent::LIBRARY>);
-       add("module",      &Loader::component_arg<BinaryComponent, BinaryComponent::Type, BinaryComponent::MODULE>);
-       add("program",     &Loader::component_arg<BinaryComponent, BinaryComponent::Type, BinaryComponent::PROGRAM>);
+       add("library",     &Loader::component_arg<BinaryComponent, BinaryComponent::Type>, BinaryComponent::LIBRARY);
+       add("module",      &Loader::component_arg<BinaryComponent, BinaryComponent::Type>, BinaryComponent::MODULE);
+       add("program",     &Loader::component_arg<BinaryComponent, BinaryComponent::Type>, BinaryComponent::PROGRAM);
        add("source_archive", &Loader::source_archive);
        add("source_tarball", &Loader::source_archive);
        add("tarball",     &Loader::tarball);
@@ -222,8 +222,8 @@ void SourcePackage::Loader::component(const string &n)
        obj.components.push_back(comp);
 }
 
-template<typename C, typename A, A a>
-void SourcePackage::Loader::component_arg(const string &n)
+template<typename C, typename A>
+void SourcePackage::Loader::component_arg(A a, const string &n)
 {
        C *comp = new C(obj, n, a);
        load_sub(*comp);
index 68b89c85279e4ab9327be954b457f4f8a2742de2..fce58a659fdd925f5b18411ff06035890d6797ca 100644 (file)
@@ -36,8 +36,8 @@ public:
                void feature(const std::string &, const std::string &);
                template<typename C>
                void component(const std::string &);
-               template<typename C, typename A, A>
-               void component_arg(const std::string &);
+               template<typename C, typename A>
+               void component_arg(A, const std::string &);
                void build_info();
                void generate(const std::string &);
                void interface_version(const std::string &);