From 072ee46e8a3c4217f82639df5153388914009b70 Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Tue, 16 Jun 2026 20:38:43 -0700 Subject: [PATCH] Use no-exceptions-friendly macros for try/catch block This fixes build breakages when -fno-exceptions is used --- src/pthread/thread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index bcaa78707..ec98e1b37 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -515,7 +515,7 @@ namespace boost unsigned thread::physical_concurrency() BOOST_NOEXCEPT { #ifdef __linux__ - try { + BOOST_TRY { using namespace std; ifstream proc_cpuinfo ("/proc/cpuinfo"); @@ -570,9 +570,10 @@ namespace boost // Fall back to hardware_concurrency() in case // /proc/cpuinfo is formatted differently than we expect. return cores.size() != 0 ? cores.size() : hardware_concurrency(); - } catch(...) { + } BOOST_CATCH(...) { return hardware_concurrency(); } + BOOST_CATCH_END #elif defined(__APPLE__) int count; size_t size=sizeof(count);