From 4c15d81befef5bccd05f1a4afeacd3451c295e79 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 12 Sep 2023 23:33:11 +0800 Subject: improve check func --- xmake/modules/lib/detect/check_cxsnippets.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xmake/modules/lib/detect/check_cxsnippets.lua b/xmake/modules/lib/detect/check_cxsnippets.lua index 08055c3d8..bbcb15e23 100644 --- a/xmake/modules/lib/detect/check_cxsnippets.lua +++ b/xmake/modules/lib/detect/check_cxsnippets.lua @@ -56,19 +56,15 @@ end -- sigsetjmp{int a = 0; sigsetjmp((void*)a, a);} -- function _funccode(funcinfo) - - -- parse function code local code = string.match(funcinfo, ".+{(.+)}") if code == nil then local pos = funcinfo:find("%(") if pos then code = funcinfo else - code = string.format("volatile void* p%s = (void*)&%s;", funcinfo, funcinfo) + code = string.format("volatile void* p%s = (void*)&%s; if (p%s) {}", funcinfo, funcinfo, funcinfo) end end - - -- ok return code end -- cgit v1.3.1