From 674b0275a6333deaa2fee15f12cffaa14a099a96 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Mon, 28 Aug 2023 23:17:43 +0200 Subject: [PATCH] C API: fix: macos doesn't have std::bind_front --- src/libexpr/c/nix_api_value.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libexpr/c/nix_api_value.cc b/src/libexpr/c/nix_api_value.cc index 8b73729a5b78..2348b75ed857 100644 --- a/src/libexpr/c/nix_api_value.cc +++ b/src/libexpr/c/nix_api_value.cc @@ -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);