C API: fix: macos doesn't have std::bind_front

This commit is contained in:
Yorick van Pelt 2023-08-28 23:17:43 +02:00 committed by José Luis Lafuente
parent ab9250286a
commit c6e28d8da2
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A

View file

@ -62,6 +62,7 @@ PrimOp * nix_alloc_primop(
if (context)
context->last_err_code = NIX_OK;
try {
using namespace std::placeholders;
auto p = new
#ifdef HAVE_BOEHMGC
(GC)
@ -71,7 +72,7 @@ PrimOp * nix_alloc_primop(
.args = {},
.arity = (size_t) arity,
.doc = doc,
.fun = std::bind_front(nix_c_primop_wrapper, fun, user_data)};
.fun = std::bind(nix_c_primop_wrapper, fun, user_data, _1, _2, _3, _4)};
if (args)
for (size_t i = 0; args[i]; i++)
p->args.emplace_back(*args);