mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
Make primop registration pluggable
This way we don't have to put all primops in one giant file.
This commit is contained in:
parent
96515b0c0d
commit
12b257f045
4 changed files with 33 additions and 3 deletions
15
src/libexpr/primops.hh
Normal file
15
src/libexpr/primops.hh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "eval.hh"
|
||||
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
namespace nix {
|
||||
|
||||
struct RegisterPrimOp
|
||||
{
|
||||
typedef std::vector<std::tuple<std::string, size_t, PrimOpFun>> PrimOps;
|
||||
static PrimOps * primOps;
|
||||
RegisterPrimOp(std::string name, size_t arity, PrimOpFun fun);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue