From 73d59ba20e1a646ec1f402f274bdacf4f8999de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=A4=B4=E4=BA=91?= <372449116@qq.com> Date: Mon, 15 Dec 2025 10:21:40 +0000 Subject: [PATCH] fix(log): add missing LIBIPC_LOG() and fix lambda log capture - src/libipc/prod_cons.h: * Add LIBIPC_LOG() to second force_push() template function * This was missing, causing 'log' to be undeclared at line 379 - src/libipc/ipc.cpp: * Add LIBIPC_LOG() to static send() function (line 590) * Capture log by reference in outer lambda: [tm, &log] * Capture log by reference in inner lambda: [tm, &log, info, que, msg_id] * This fixes 'log' was not declared error in lambda at line 598 * The log variable is now properly captured from the outer send() scope These fixes ensure that all functions using log.debug/error/warning have proper LIBIPC_LOG() initialization and lambda captures. --- src/libipc/ipc.cpp | 5 +++-- src/libipc/prod_cons.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libipc/ipc.cpp b/src/libipc/ipc.cpp index e89f435..26bf1e9 100755 --- a/src/libipc/ipc.cpp +++ b/src/libipc/ipc.cpp @@ -588,8 +588,9 @@ static bool send(F&& gen_push, ipc::handle_t h, void const * data, std::size_t s } static bool send(ipc::handle_t h, void const * data, std::size_t size, std::uint64_t tm) { - return send([tm](auto *info, auto *que, auto msg_id) { - return [tm, info, que, msg_id](std::int32_t remain, void const * data, std::size_t size) { + LIBIPC_LOG(); + return send([tm, &log](auto *info, auto *que, auto msg_id) { + return [tm, &log, info, que, msg_id](std::int32_t remain, void const * data, std::size_t size) { if (!wait_for(info->wt_waiter_, [&] { return !que->push( [](void*) { return true; }, diff --git a/src/libipc/prod_cons.h b/src/libipc/prod_cons.h index 482f058..ca00b7c 100755 --- a/src/libipc/prod_cons.h +++ b/src/libipc/prod_cons.h @@ -365,6 +365,7 @@ struct prod_cons_impl> { template bool force_push(W* wrapper, F&& f, E* elems) { + LIBIPC_LOG(); E* el; circ::u2_t cur_ct; rc_t epoch = epoch_.fetch_add(ep_incr, std::memory_order_release) + ep_incr;